what this regex tells

Any questions involving matching text strings to patterns - the pattern is called a "regular expression."

Moderator: General Moderators

Post Reply
iffo
Forum Commoner
Posts: 37
Joined: Thu Oct 05, 2006 11:56 am

what this regex tells

Post by iffo »

Hi,

'regex' => '/^[0-9]+$/',

here i undersnad it will allow 0-9 , but then what does + and $ mean?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

^ start of subject/line
[0-9] any digit 0-9
+ 1 or omore ccurrences
$ end of subject/line

see also: http://de2.php.net/manual/en/reference. ... syntax.php
iffo
Forum Commoner
Posts: 37
Joined: Thu Oct 05, 2006 11:56 am

Post by iffo »

thanks a lot
Post Reply