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


*This works perfectly in the several online checkers I've used, such 
as https://regex101.com/*
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

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/b478c102-d80f-4726-8070-dc8dd4ac47ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to