Posted by Jeff on 03/22/07 16:24
What your original regular expression is saying is that the last
character in the string is a + or a number 0 thru 9.
/^\+?[0-9 ]+$/
What Toby's expression is saying is that it starts with an optional +
(? means 0 or 1) and then has 1 or more #'s or spaces in a row until
the end of the string.
The ^ means starting at the beginning of the string and the $ means
the end.
Hope that helps explain it somewhat.
Navigation:
[Reply to this message]
|