in reply to Perl Complains of Nested Quantifiers
Update: Obviously, I should've tested my theory before shooting off my mouth. ww gave it a try (nice catch!) and didn't see the problem, when I tried, I couldn't reproduce either.
The problem is that you're asking for "one or more one or more digits". You either mean one or more digits, or one or more digits followed by a '+':
/(\d+\.\d+)/oi; # One or more digits /(\d+\+\.\d+\+)/oi; # One or more digits with '+'
Since you mention greediness, you might mean to not take too many items from the string. However, since you're taking only digits and have a literal '.' between them, I don't know what you'd really mean. (\d+? doesn't make any sense, unless it were something like \d+?7, for example.)
...roboticus
When your only tool is a hammer, all problems look like your thumb.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl Complains of Nested Quantifiers
by sunmaz (Novice) on May 22, 2012 at 16:14 UTC | |
by Kenosis (Priest) on May 22, 2012 at 17:24 UTC |