Skip to content

Commit

Permalink
fix json regex anchoring
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Dec 11, 2024
1 parent 647f36f commit 006f463
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions parser/src/json/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,10 @@ impl Compiler {
if !left_anchored {
result.push_str(".*");
}
// without parens, for a|b we would get .*a|b.* which is (.*a)|(b.*)
result.push_str("(");
result.push_str(trimmed);
result.push_str(")");
if !right_anchored {
result.push_str(".*");
}
Expand Down

0 comments on commit 006f463

Please sign in to comment.