in reply to What does this regex do?
So thats what the regex does. But it doesn't look quite right for its stated purpose -- for example, your numbers could have two decimal points. --Dave$interest !~ / # match against $interest (negated) ^ # start of line -? # optional minus sign \.? # optional decimal point \d+ # 1 or more digits (?: # start non-capturing group (i.e. not $1) \. # decimal point \d+ # 1 or more digits )? # end of group -- match 0 or 1 times $ # end of line /x; # end of regex (the /x modifier allows # comments in the regex -- can be useful)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: What does this regex do?
by dpuu (Chaplain) on Apr 01, 2003 at 19:44 UTC |