diff options
| -rw-r--r-- | challenge-002/andrezgz/perl5/ch-1.pl | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/challenge-002/andrezgz/perl5/ch-1.pl b/challenge-002/andrezgz/perl5/ch-1.pl index 36addeca96..52f8af5a65 100644 --- a/challenge-002/andrezgz/perl5/ch-1.pl +++ b/challenge-002/andrezgz/perl5/ch-1.pl @@ -32,10 +32,13 @@ # 01. -> 1. # 01.0 -> 1.0 # 010.0 -> 10.0 +# 00.1 -> 0.1 + +# + All the above with a comma instead of a dot use strict; my $number = @ARGV[0]; -$number =~ s/^0+([1-9][0-9]*(:?[.,]\d*)?)$/$1/; +$number =~ s/^0+([1-9]*[0-9]+(:?[.,]\d*)?)$/$1/; print $number; |
