Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
20 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Gunnar Strand-2
Hi Jan,

On 09/19/14 09:38, Jan Seidel wrote:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

No, the regex can consume "GUIDE_P4" using "GUIDE_(.*)" which is then not followed by "P4" and so is true. I am not aware of any way to write one expression to do what you want. You need a separate test for excluding names with "P4" at the end.


My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

That is strange since it should match all names containing "GUIDE_". I am unsure of the context, but your code should be something like this pseudo code:

if ( name != /P4$/ ) {
  println name;
}

BR
Gunnar

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Gunnar Strand-2
Hi,

I did of course not read the subject. Shame on me.

The answer below is for regex in general, not sure how applicable it is to the Matrix Authorization Strategy Plugin (not using it).

BR
Gunnar

On 09/19/14 09:57, Gunnar Strand wrote:
Hi Jan,

On 09/19/14 09:38, Jan Seidel wrote:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

No, the regex can consume "GUIDE_P4" using "GUIDE_(.*)" which is then not followed by "P4" and so is true. I am not aware of any way to write one expression to do what you want. You need a separate test for excluding names with "P4" at the end.


My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

That is strange since it should match all names containing "GUIDE_". I am unsure of the context, but your code should be something like this pseudo code:

if ( name != /P4$/ ) {
  println name;
}

BR
Gunnar

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Jan Seidel-2
True (.*) is very greedy, but (?!P4) is a but not P4 and I would expect it to work.
It isn't as I just figured out in a test run with a completely different RegEx to skim for other jobs :/

I got to tweak it and create a set of project rules and then combine them for each user depending on what they need to know *geesh*
Thanks for the hint.

Jan


Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Jan Seidel-2
Yay, got it.
A set of projects rules. each one containing a positve match and then combine the rule works well.

One odd thing I learned is, that you don't need wildcards if your match has a trailing string.

e.g. MB_GUIDE_Pxxxxxxx_P4_DELIVERY will also be found when you work with (.*)GUIDE_(.*)P4

You can by the way combine RegEx like this (.*)GUIDE_MIB(.*)|(.*)GUIDE_(.*)P4 the pipe "|" works well one positive matches. negative matches don't make fun with it

Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Gunnar Strand-2
In reply to this post by Jan Seidel-2

On 09/19/14 11:27, Jan Seidel wrote:
True (.*) is very greedy, but (?!P4) is a but not P4 and I would expect it to work.
It isn't as I just figured out in a test run with a completely different RegEx to skim for other jobs :/

I don't know what kind of regex the Matrix supports, but "X(?!Y)" normally means "X" not followed by "Y". If you precede it with a match anything repeating pattern: "X.*(?!Y), the parser will happily match "XY" where "Y" is matched using the ".*" pattern, and determine that the matching string XY is not followed by "Y", hence it returns true. Using a negative look-ahead pattern is tricky, you must anchor the pattern to something.

BR
Gunnar


I got to tweak it and create a set of project rules and then combine them for each user depending on what they need to know *geesh*
Thanks for the hint.

Jan


Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Gunnar Strand-2
In reply to this post by Jan Seidel-2

On 09/19/14 11:44, Jan Seidel wrote:
Yay, got it.
A set of projects rules. each one containing a positve match and then combine the rule works well.

One odd thing I learned is, that you don't need wildcards if your match has a trailing string.

e.g. MB_GUIDE_Pxxxxxxx_P4_DELIVERY will also be found when you work with (.*)GUIDE_(.*)P4

You can by the way combine RegEx like this (.*)GUIDE_MIB(.*)|(.*)GUIDE_(.*)P4 the pipe "|" works well one positive matches. negative matches don't make fun with it

The "^" and the "$" commands matches the beginning of the string and the end of the string, respectively. Some parsers, or rather some designers, adds these commands to the pattern, ie "GUIDE_.*P4" would actually be "^GUIDE_.*P4$" and would not match "MB_GUIDE_P4" nor "GUIDE_P4_DELIVERY".

However, that does *not* appear to the case above, which is why your pattern matches the "P4_DELIVERY" name above. You need to add "^" and "$" yourself if you want to include "starts with" and "ends with" parts for the pattern.

If you know which text the '.*' will match, then you could do this:

GUIDE_(?!MIB)(FOO|BAR|BAZ)(?!P4)$

This should match any name containing GUIDE_, where GUIDE_ is not followed by MIB, and then followed by one of a specific list of possible strings, which are not followed by "P4". Remove the "$" at the end if the name may contain other text after the FOO/BAR/BAZ part.

BR
Gunnar


Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan
--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Richard Lavoie
In reply to this post by Jan Seidel-2
As a few people already mentioned you need to anchor your pattern. Otherwise, .* might match what you want to exclude and attempt the match after it, resulting in an unwanted result.

What your regx is doing in words is this:

(.*) match anywhere
GUIDE_ : normal text match
(?!MIB) : immediately not followed by MIB
(.*) : match anywhere
(?!P4) : not followed by P4

Now, what you want to do if MIB and P4 can be anywhere after GUIDE_ is to match every character and the make sure it is not followed by any of those, up to the end. The regex for that would be:

(.*)GUIDE_(?:(?!MIB)(?!P4).)*$

The fancy part at the end translates into :

Make sure the following text is neither MIB or P4 when you try to match the next char, up to the end of string. it does not make a distinction weither MIB comes before or after P4. It will make sure any of those is not after GUIDE_

Richard Lavoie

On 2014-09-19, at 03:38, Jan Seidel <[hidden email]> wrote:

Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Richard Lavoie
If you want to allow that MIB can appear anywhere else other that immmediately after GUIDE_ you can change the regex for :

(.*)GUIDE_(?!MIB)((?!P4).)*$

Richard Lavoie

On 2014-09-19, at 06:52, Richard Lavoie <[hidden email]> wrote:

As a few people already mentioned you need to anchor your pattern. Otherwise, .* might match what you want to exclude and attempt the match after it, resulting in an unwanted result.

What your regx is doing in words is this:

(.*) match anywhere
GUIDE_ : normal text match
(?!MIB) : immediately not followed by MIB
(.*) : match anywhere
(?!P4) : not followed by P4

Now, what you want to do if MIB and P4 can be anywhere after GUIDE_ is to match every character and the make sure it is not followed by any of those, up to the end. The regex for that would be:

(.*)GUIDE_(?:(?!MIB)(?!P4).)*$

The fancy part at the end translates into :

Make sure the following text is neither MIB or P4 when you try to match the next char, up to the end of string. it does not make a distinction weither MIB comes before or after P4. It will make sure any of those is not after GUIDE_

Richard Lavoie

On 2014-09-19, at 03:38, Jan Seidel <[hidden email]> wrote:

Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Gunnar Strand-2
X(?!Y) works when it is used in a RegEx but the plugins botches as soon as you start to combine several negations.

X(?!Y)|A(!?B) won't behave as expected.
Applying the de Morgan's law (double negation to create and AND from an OR) does not interest the plugin at all.
I tried (!?(X(?!Y)|A(!?B)), (!?((X(?!Y)|A(!?B))) and all other combinations that made sense to me.

Latest crime I committed was: (!?((!?((.*)GUIDE_MIB.*))|(!?((.*)GUIDE_Pxxxxxx(.*)))|(!?((.*)GUIDE_(.*)P4))))
Looks like that Jenkins does not care about negations when combining patterns :/

Am Freitag, 19. September 2014 12:04:24 UTC+2 schrieb Gunnar Strand:

On 09/19/14 11:27, Jan Seidel wrote:
True (.*) is very greedy, but (?!P4) is a but not P4 and I would expect it to work.
It isn't as I just figured out in a test run with a completely different RegEx to skim for other jobs :/

I don't know what kind of regex the Matrix supports, but "X(?!Y)" normally means "X" not followed by "Y". If you precede it with a match anything repeating pattern: "X.*(?!Y), the parser will happily match "XY" where "Y" is matched using the ".*" pattern, and determine that the matching string XY is not followed by "Y", hence it returns true. Using a negative look-ahead pattern is tricky, you must anchor the pattern to something.

BR
Gunnar

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Gunnar Strand-2
GUIDE_(?!MIB)(FOO|BAR|BAZ)(?!P4)$ is a nice idea.
I have been working with it quite at the beginning of my test cases but I neglected ^ and $.
This may be the hint I needed to anchor the parttern. :)

Cheers

Am Freitag, 19. September 2014 12:20:49 UTC+2 schrieb Gunnar Strand:

On 09/19/14 11:44, Jan Seidel wrote:
Yay, got it.
A set of projects rules. each one containing a positve match and then combine the rule works well.

One odd thing I learned is, that you don't need wildcards if your match has a trailing string.

e.g. MB_GUIDE_Pxxxxxxx_P4_DELIVERY will also be found when you work with (.*)GUIDE_(.*)P4

You can by the way combine RegEx like this (.*)GUIDE_MIB(.*)|(.*)GUIDE_(.*)P4 the pipe "|" works well one positive matches. negative matches don't make fun with it

The "^" and the "$" commands matches the beginning of the string and the end of the string, respectively. Some parsers, or rather some designers, adds these commands to the pattern, ie "GUIDE_.*P4" would actually be "^GUIDE_.*P4$" and would not match "MB_GUIDE_P4" nor "GUIDE_P4_DELIVERY".

However, that does *not* appear to the case above, which is why your pattern matches the "P4_DELIVERY" name above. You need to add "^" and "$" yourself if you want to include "starts with" and "ends with" parts for the pattern.

If you know which text the '.*' will match, then you could do this:

GUIDE_(?!MIB)(FOO|BAR|BAZ)(?!P4)$

This should match any name containing GUIDE_, where GUIDE_ is not followed by MIB, and then followed by one of a specific list of possible strings, which are not followed by "P4". Remove the "$" at the end if the name may contain other text after the FOO/BAR/BAZ part.

BR
Gunnar


--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Richard Lavoie
Nice advice! :)

what does ?: actually imply?
Where do I find this information?

If you want to allow that MIB can appear anywhere else other that immmediately after GUIDE_ you can change the regex for :
(.*)GUIDE_(?!MIB)((?!P4).)*$

This pattern confuses me a bit... Ooooohh.... now I get it. Dumb little me XD
That explains another issue I have. *geesh* I start to become dizzy of RegEx

Thanks for helping out.
I will do some tests right away

Cheers
Jan

Am Freitag, 19. September 2014 12:53:12 UTC+2 schrieb DarkRift:
As a few people already mentioned you need to anchor your pattern. Otherwise, .* might match what you want to exclude and attempt the match after it, resulting in an unwanted result.

What your regx is doing in words is this:

(.*) match anywhere
GUIDE_ : normal text match
(?!MIB) : immediately not followed by MIB
(.*) : match anywhere
(?!P4) : not followed by P4

Now, what you want to do if MIB and P4 can be anywhere after GUIDE_ is to match every character and the make sure it is not followed by any of those, up to the end. The regex for that would be:

(.*)GUIDE_(?:(?!MIB)(?!P4).)*$

The fancy part at the end translates into :

Make sure the following text is neither MIB or P4 when you try to match the next char, up to the end of string. it does not make a distinction weither MIB comes before or after P4. It will make sure any of those is not after GUIDE_

Richard Lavoie


 

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Jan Seidel-2
It works like a charm :)

Thank you two for helping me out on this one.

Jan

Am Freitag, 19. September 2014 09:38:17 UTC+2 schrieb Jan Seidel:
Hi all,

I have a weird issue with a regular expression.
Hopefully you can help me out here.

I have a RegEx like (.*)GUIDE_(?!MIB)(.*)(?!P4)
It should, as far as I can tell, list all jobs containing GUIDE but exclude GUIDE jobs with a MIB in the middle or P4 at the end of the project name, right?

My problem here is, that jobs with a P4 at the end still are listed :(

I have for testing purposes tried all kind of RegEx that crossed my mind but without any success.
Later I tried just to exclude job names with a P4 at the end. No joy

The RegEx I used was: (.*)GUIDE_(.*)(?!P4)
The list is then completely emtpy.

Can someone tell me where I glitch?

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Jan Seidel-2
Last but not least.
Looks like Jenkins adheres to Java Regex, even if I sometimes doubted it.

"(?:X) X, as a non-capturing group"
Does this mean ... "don't jump on this pattern"?
Sorry, I'm no developer :)

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Richard Lavoie
What ( ) does is that whenever it matches the inner pattern, it keeps it in memory for further reference in code.

(?: ) allows to have a complex inner pattern with OR cases without keeping the matched content in memory.

That's what mean "non-capturing" for (?:).

Also www.regular-expressions.info has a really nice reference on regex and also tells you which engine supports which feature.

Richard Lavoie

On 2014-09-22, at 05:03, Jan Seidel <[hidden email]> wrote:

Last but not least.
Looks like Jenkins adheres to Java Regex, even if I sometimes doubted it.

"(?:X) X, as a non-capturing group"
Does this mean ... "don't jump on this pattern"?
Sorry, I'm no developer :)

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Jan Seidel-2
In reply to this post by Jan Seidel-2
Thanks for the explanation :)
The site you have mentioned is indeed a real nice one. It is already added to my bookmarks.

Cheers
Jan

--
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 [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Raj Kiran Neerukonda
In reply to this post by Jan Seidel-2
Hello,

I am having similar problem. Right now i am having multiple directories, i need to control access to sub directories. For example, i have component specific jenkins jobs in 

parent/project/component/* 

How can i configure this pattern in role base authentication?

I tried giving parent/project/component|parent/project/component/* 

it dint worked. Please help me. 

Thank you,

Raj Kiran.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b2514fd7-d0d7-4e8e-97e3-58e4099eadf2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Prachi Khadke
Hi Raj Kiran

Did you find a solution to your problem? I have the same issue. Need to figure out the correct regex for project level role based access control. 

Regards
Prachi

On Monday, July 10, 2017 at 3:24:07 AM UTC-4, Raj Kiran Neerukonda wrote:
Hello,

I am having similar problem. Right now i am having multiple directories, i need to control access to sub directories. For example, i have component specific jenkins jobs in 

parent/project/component/* 

How can i configure this pattern in role base authentication?

I tried giving parent/project/component|parent/project/component/* 

it dint worked. Please help me. 

Thank you,

Raj Kiran.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dc1e2c6d-e0c6-4d88-949d-52db99665efc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Prachi Khadke
Hi

Okay I found a workaround: https://issues.jenkins-ci.org/browse/JENKINS-19934?focusedCommentId=219352&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-219352

Regards
Prachi

On Wednesday, July 12, 2017 at 1:12:22 PM UTC-4, Prachi Khadke wrote:
Hi Raj Kiran

Did you find a solution to your problem? I have the same issue. Need to figure out the correct regex for project level role based access control. 

Regards
Prachi

On Monday, July 10, 2017 at 3:24:07 AM UTC-4, Raj Kiran Neerukonda wrote:
Hello,

I am having similar problem. Right now i am having multiple directories, i need to control access to sub directories. For example, i have component specific jenkins jobs in 

parent/project/component/* 

How can i configure this pattern in role base authentication?

I tried giving parent/project/component|parent/project/component/* 

it dint worked. Please help me. 

Thank you,

Raj Kiran.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9c044b15-bfa6-4616-91bc-19aaeebbc1ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Artur Szostak
In reply to this post by Raj Kiran Neerukonda
Looks like you might be confusing a glob with a regex.
You probably want:
  (parent/project/component)|(parent/project/component/.*)

________________________________________
From: [hidden email] <[hidden email]> on behalf of Raj Kiran Neerukonda <[hidden email]>
Sent: 10 July 2017 01:11:30
To: Jenkins Users
Subject: Re: Issue with RegEx for project roles in Matrix Authorization Strategy Plugin

Hello,

I am having similar problem. Right now i am having multiple directories, i need to control access to sub directories. For example, i have component specific jenkins jobs in

parent/project/component/*

How can i configure this pattern in role base authentication?

I tried giving parent/project/component|parent/project/component/*

it dint worked. Please help me.

Thank you,

Raj Kiran.

--
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 [hidden email]<mailto:[hidden email]>.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b2514fd7-d0d7-4e8e-97e3-58e4099eadf2%40googlegroups.com<https://groups.google.com/d/msgid/jenkinsci-users/b2514fd7-d0d7-4e8e-97e3-58e4099eadf2%40googlegroups.com?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/d/optout.

--
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 [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/dd00dea43dac449b89e8e72e59d3d428%40partner.eso.org.
For more options, visit https://groups.google.com/d/optout.
Loading...