09-29-2007, 01:45 AM
|
#1 (permalink)
|
|
The Frequenter
Join Date: Sep 2007
Posts: 360
Thanks: 24
|
Regular Expressions
I'm having trouble with regular expressions. I think I have done something wrong within them since they're accepting the data even if they don't match the pattern.
$pattern = '/^[0-9]{3}$/'; suppose to match 000
$pattern = '/^[0-9]{3}\-[0-9]{3}\-[0-9]{3}$/'; suppose to match 000-000-00
$pattern = '/^[0-9]{5}$/'; suppose to match 00000
$pattern = '/^www\.[a-zA-Z0-9\-]+\.([a-zA-Z\.]{2,4})$/'; - suppose to match www.domain.ext.(w/e)
Help :(
|
|
|
|