Neil Thompson
asked on
check my variables with this regex? 1[0-9]{6}[xX0-9]{1}
Hi
I'm moving some code from Java to PHP and I have a variable ( $paymentReference1 ) that I need to check againse this regex ( 1[0-9]{6}[xX0-9]{1} )
Can someone show me what to do please and possible explain the regex a little
Many thanks
Neil
I'm moving some code from Java to PHP and I have a variable ( $paymentReference1 ) that I need to check againse this regex ( 1[0-9]{6}[xX0-9]{1} )
Can someone show me what to do please and possible explain the regex a little
Many thanks
Neil
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Still cant get this to work, probably doing something wrong
Using as a test:
This should come back as pass
error_log(ereg("10948055", "1[0-9]{6}[xX0-9]{1}"));
This should Fail
error_log(ereg("50948055", "1[0-9]{6}[xX0-9]{1}"));
Neither seem to do anything?
Neil
Using as a test:
This should come back as pass
error_log(ereg("10948055",
This should Fail
error_log(ereg("50948055",
Neither seem to do anything?
Neil
ASKER
got it, used preg_match in the end
ASKER
Thanks
Neil
Neil
http://www.zytrax.com/tech/web/regex.htm
mms_master