Possible Duplicate:
Converting ereg expressions to preg
I have this ereg() expression:
^[0-9]{8}\T{1}[0-9]{2}\:[0-9]{2}\:[0-9]{2}$
How can I convert it to the preg_match one?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The expression looks fine, but you can simplify it:
Your original one should still work with
preg, but the one above is simpler to read and understand. A few notes:[0-9]is the same as\d{1}is unnecessary:does not need escaping