preg_match
Posted: Fri Jul 16, 2004 8:51 am
Hi.
My problem regards the use of preg_match... I send a variable to a function and then I use preg_match on it.
There are 3 different valid expressions I want to check for.. These are:
xxxxx...-xx...-x...
xxxx-xx-xx-x...
xxxx-xx-xxxx-xx-xx-x...
where "x" is a digit [0-9] and "..." is more digits. The numeric sequences are seperated by "-".
All other expressions should result in an error message.
I know that this can be done with preg_match, but not how... Anyone?
Regards tores
My problem regards the use of preg_match... I send a variable to a function and then I use preg_match on it.
There are 3 different valid expressions I want to check for.. These are:
xxxxx...-xx...-x...
xxxx-xx-xx-x...
xxxx-xx-xxxx-xx-xx-x...
where "x" is a digit [0-9] and "..." is more digits. The numeric sequences are seperated by "-".
All other expressions should result in an error message.
I know that this can be done with preg_match, but not how... Anyone?
Regards tores