Thread
:
regular expression
View Single Post
#
2
(
permalink
)
06-26-09, 03:34 AM
Nico
Community Leader
Join Date: Sep 2005
Location: Spain
Posts: 7,536
Thanks: 5
Thanked 20 Times in 18 Posts
PHP Code:
'~^\d{4}[ ]?[a-z]{2}$~i'
And get used to preg_match() rather than the ereg* functions. They're way slower and they're gonna be disabled by default (or removed completely, not sure) in PHP 6.
__________________
Zend Certified Engineer
Image Rotator
Nico
View Public Profile
Visit Nico's homepage!
Find all posts by Nico