Skip to content

Commit 4e49df1

Browse files
authored
Merge pull request github#12839 from jcogs33/jcogs33/update-QueryDoc-regex
QL: update regexes used in `QueryDoc.getQueryName()` and in `QueryDoc.getQueryId()/getQueryLanguage()`
2 parents 7eee589 + 06bf246 commit 4e49df1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ql/ql/src/codeql_ql/ast/Ast.qll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,17 @@ class QueryDoc extends QLDoc {
211211

212212
/** Gets the @name for the query */
213213
string getQueryName() {
214-
result = this.getContents().regexpCapture("(?s).*@name ([\\w-\\s]+)(?=\\n).*", 1)
214+
result = this.getContents().regexpCapture("(?s).*@name (.+?)(?=\\n).*", 1)
215215
}
216216

217217
/** Gets the id part (without language) of the @id */
218218
string getQueryId() {
219-
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 2)
219+
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-/]+)\\s.*", 2)
220220
}
221221

222222
/** Gets the language of the @id */
223223
string getQueryLanguage() {
224-
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 1)
224+
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-/]+)\\s.*", 1)
225225
}
226226
}
227227

0 commit comments

Comments
 (0)