Hey!
I hope I'm posting this in the correct place, it's my first request here, usually I can find the answers to my questions somewhere on the Web...
I'm currently trying to define a Compiler Warning with the provided Jenkins plugin UI. I've done it several times in the past with basic regular expressions but this time, I need to set Regex modifiers.
Here is my simplified regular expression:
(?sm)begin((?:(?!begin).)*)end
Here is a sample of trace I'm parsing:
begin
begin
error trace
end of step x
begin
begin
begin
error 1
error 2
end of step y
begin
The output expected is the following (divided in 2 warnings):
error trace
error 1
error 2
The only difference with this Regex compared to the other ones that are working fine, is that this time I'm using modifiers: (?sm).
FYI, here is also the Groovy script of the Compiler Warning:
import hudson.plugins.warnings.parser.Warning
import hudson.plugins.analysis.util.model.Priority
String fileName = matcher.group(1)
String category = "my-error"
return new Warning(fileName, 0, category, category, "Errors detected", Priority.Normal);
This is driving me crazy... So here are my questions:
1. is the use of regex modifiers supported by the plugin Compiler Warnings? If so, am I correctly using them?
2. is there another way to bypass this issue (by declaring the Regex differently or by using another plugin for instance)?
3. is there an easy way to test Regex that are supported by Jenkins, without creating a dedicated job?
Please note that I posted a simplified expression, I'm not looking for a way to change my expression because I do need to have both multiline and dotall modifiers applied to perform my real parsing.
Any kind of feedback would be welcome!!
Regards,
Tyoneb