Just Me
asked on
regex help : check contents of capturing group
I have the following string:
op=func&test1=abcd&test2=t est
Using a regex in an apache rewritecond I'm wanting to extract the value assigned to test1
this results in 3 capture groups:
1) op=func
2) abcd
3) &test2=test
which is great, I can use all these elements in my apaache rewriterule
However, I'm only interested in finding a match where capture group 2 (in this case, "abcd") contains a lowercase character. This string can be any length. If the value was "ABCD" I dont want to find a match.
How can this be done
op=func&test1=abcd&test2=t
Using a regex in an apache rewritecond I'm wanting to extract the value assigned to test1
^(.+)&test1=([^&]+)(.*)$
this results in 3 capture groups:
1) op=func
2) abcd
3) &test2=test
which is great, I can use all these elements in my apaache rewriterule
However, I'm only interested in finding a match where capture group 2 (in this case, "abcd") contains a lowercase character. This string can be any length. If the value was "ABCD" I dont want to find a match.
How can this be done
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Yeah, I did not pay attention. My regex checks if there is a lower case character in group 3.
ASKER
Thanks both