Merge pull request #12839 from jcogs33/jcogs33/update-QueryDoc-regex

QL: update regexes used in `QueryDoc.getQueryName()` and in `QueryDoc.getQueryId()/getQueryLanguage()`
This commit is contained in:
Erik Krogh Kristensen
2023-04-17 09:03:03 +02:00
committed by GitHub

View File

@@ -211,17 +211,17 @@ class QueryDoc extends QLDoc {
/** Gets the @name for the query */
string getQueryName() {
result = this.getContents().regexpCapture("(?s).*@name ([\\w-\\s]+)(?=\\n).*", 1)
result = this.getContents().regexpCapture("(?s).*@name (.+?)(?=\\n).*", 1)
}
/** Gets the id part (without language) of the @id */
string getQueryId() {
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 2)
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-/]+)\\s.*", 2)
}
/** Gets the language of the @id */
string getQueryLanguage() {
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-]+)\\s.*", 1)
result = this.getContents().regexpCapture("(?s).*@id (\\w+)/([\\w\\-/]+)\\s.*", 1)
}
}