Can anyone help me formulate a regular expression for the following
The valid entries are
So anything with just numbers or a + in front of the numbers is valid...
thanx in advance....
hmm... assuming it is Perl compatible, what about
thanx.... I better learn regular expressions properly.. seems really usefull..
hehe, coming back to this thread I just realised I gave a wrong pattern and no one corrected me.
Those patterns would not match the digits only expressions.
You should use:
I'm using slashes as pattern delimiters, while ^ indicates the start, $ the end.
\+ is a literal plus symbol, having been escaped.
? means 0 or 1 instances of the character/subpattern that precedes it.
\d should be equivalent to [0-9], meaning a character from 0 to 9.
then + means 1 or more instances of the character/subpattern that precedes it.