However, after various tries with regexpMatch and matches the query cannot capture the proper pattern even though I have tried the same pattern using RegExr and it is working as expected.
The text was updated successfully, but these errors were encountered:
Your regular expression should be "pack.*" -- that is, pack followed by zero or more arbitrary characters. "pack*" would mean the that the text of the directive needs to be pac followed by zero or more copies k.
(It looks like you were trying to use filename globbing syntax rather than regular expressions).
You could also write .matches("pack%") if you prefer the more SQL-like pattern syntax that matches uses.
Finally, for general neatness, you'll probably want directive to have type PreprocessorPragma rather than PreprocessorDirective).
I am trying to recognize
#pragma packdirective forMSVC. Therefore, I have wrote this simple query:to capture the following two pack pragmas in this sample:
However, after various tries with
regexpMatchandmatchesthe query cannot capture the proper pattern even though I have tried the same pattern using RegExr and it is working as expected.The text was updated successfully, but these errors were encountered: