PHP preg_match function always return false? -
I just started learning PHP days ago and got the hand with the This is not a valid regular expression, you are missing the delimiter: You also get a warning about missing delimiters Education will be notified. Turn on / off your error reporting level preg_match () function I am wondering why the following always makes false?
preg_match ('[AZ] {2}', 'CA')
preg_match ('/ [AG] {2} /', 'CA' )
/ is a common delimiter but you want to use any limit (unless it is alphanumeric, not a backslash or whitespace ):
preg_match ('@ [AZ] {2} @', 'ca') preg_match ('% [AZ] {2}%', 'ca')
Comments
Post a Comment