Link to home
Start Free TrialLog in
Avatar of Just Me
Just Me

asked on

regex help : check contents of capturing group

I have the following string:

op=func&test1=abcd&test2=test

Using a regex in an apache rewritecond I'm wanting to extract the value assigned to test1

^(.+)&test1=([^&]+)(.*)$

Open in new window


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
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yeah, I did not pay attention. My regex checks if there is a lower case character in group 3.
Avatar of Just Me
Just Me

ASKER

Thanks both