Skip to content

Commit 9ca1ac5

Browse files
author
Alvaro Muñoz
committed
Fix expression regexp
1 parent 3150f24 commit 9ca1ac5

File tree

1 file changed

+3
-2
lines changed
  • ql/lib/codeql/actions/ast/internal

1 file changed

+3
-2
lines changed

ql/lib/codeql/actions/ast/internal/Ast.qll

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ string getADelimitedExpression(YamlString s, int offset) {
2424
// not just the last (greedy match) or first (reluctant match).
2525
result =
2626
s.getValue()
27-
.regexpFind("\\$\\{\\{\\s*[^\\}]+\\s*\\}\\}", _, offset)
28-
.regexpCapture("(\\$\\{\\{\\s*[^\\}]+\\s*\\}\\})", 1)
27+
.regexpFind("\\$\\{\\{(?:[^}]|}(?!}))*\\}\\}", _, offset)
28+
.regexpCapture("(\\$\\{\\{(?:[^}]|}(?!}))*\\}\\})", 1)
29+
.trim()
2930
}
3031

3132
private newtype TAstNode =

0 commit comments

Comments
 (0)