-
Notifications
You must be signed in to change notification settings - Fork 279
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
recognize \R for multiline regex in groovy parsers #1901
base: main
Are you sure you want to change the base?
Conversation
\R matches _any_ unicode newline sequence, and may appear in custom groovy parsers besides the usual \r and \n.
If the regex contains |
@KalleOlaviNiemitalo I'm not sure but I think that using multi line parsing for false positive matches of newline characters in the regex doesn't have negative effects besides maybe performance/memory. It only leads to "whole document" parsing instead of line based parsing AFAICS. See https://github.com/jenkinsci/warnings-ng-plugin/blob/fc29fc0ce6f1ec3ab85e2a6d4b10d59c723460a7/plugin/src/main/java/io/jenkins/plugins/analysis/warnings/groovy/GroovyParser.java#L203-208 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add the new character in
Lines 55 to 65 in 44758ba
/** | |
* Tries to expose JENKINS-35262: multi-line regular expression parser. | |
* | |
* @see <a href="https://issues.jenkins-ci.org/browse/JENKINS-35262">Issue 35262</a> | |
*/ | |
@Test | |
void issue35262() throws IOException { | |
matchMultiLine("(make(?:(?!make)[\\s\\S])*?make-error:.*(?:\\n|\\r\\n?))"); | |
matchMultiLine("(make(?:(?!make)[\\s\\S])*?make-error:.*(?:\\r?))"); | |
} | |
This was always the case and nobody reported a problem so far. |
\R matches any unicode newline sequence, and may appear in custom groovy parsers besides the usual \r and \n.
Testing done
None. Currently sitting behind a company proxy that prohibits the Maven build to download all dependencies. If you need specific tests, I would have to rework this from a private machine.
Submitter checklist