Thread
:
regular expression
View Single Post
#
2
(
permalink
)
06-26-09, 03:34 AM
Nico
Community Leader
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 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
|
My Twitter
|
HotScripts' Blog
|
HotScripts' Twitter
|
How to ask questions the smart way
Nico
View Public Profile
Visit Nico's homepage!
Find all posts by Nico