Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I cant for the life of me work out how to do this as a reg-ex even though it should be simple! :o(
I have a series of numbers which can be positive or negative with 1-3 digits following and then 1 decimal place.
Where I'm getting stuck is how to say "it MAY have a - first but maybe not and how to say "1 to 3 digits before the decimal point.
So far I had:
if ($_ =~ /^((-)d{1-3}\.\d)/) {
... but its not working :o( Where am I going wrong?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex woes...
by adamsj (Hermit) on Jul 09, 2001 at 03:33 UTC | |
by sierrathedog04 (Hermit) on Jul 09, 2001 at 04:59 UTC | |
|
Re: Regex woes...
by wog (Curate) on Jul 09, 2001 at 03:35 UTC | |
by adamsj (Hermit) on Jul 09, 2001 at 03:55 UTC | |
by wog (Curate) on Jul 09, 2001 at 04:06 UTC | |
by japhy (Canon) on Jul 09, 2001 at 07:17 UTC |