-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RegEx "negative lookahead" within XPath in scorecard #515
Comments
Regular expressions in XPath do not support lookahead or lookbehind constructs. That's why it is reported as being erroneous. See here for details on what regular expression syntax in XPath 3.1. |
As workaround, you may simply substract the sum of all transaction counts whose names contains |
With #508 we will get a way to deal with that more easily because we label things upfront and make the queries for the scorecard simpler. |
@h-arlt But maybe it is still be an known or ongoing issue to us a "?" in ExPath here. |
This page explocitly says, that negative lookahead is purposly not part of the spec:
|
The regex "negative lookahead" does not work within an XPath in the scorecard-config.JSON
For example, if you use this expression as a rule selector:
"sum(//transactions/transaction[matches(name, '^(?!.*Crawler).+$')]/count)"
you will get this Error in the Report/Scorecard:
Error evaluating rule 'visitsWithoutCrawlerCheck': [Check #0] Syntax error at char 2 in regular expression: No expression before quantifier. Found while atomizing the first argument of fn:sum() in {docOrder(((root/descendant::transactions)/transaction[fn:matches(...)])/count)} on line 1
To better reproduce and handle the issue, I am attaching my debug-scorecard-config.json.
debug-scorecard-config.json
The text was updated successfully, but these errors were encountered: