diff options
| author | andrezgz <andrezgz@gmail.com> | 2019-07-18 08:02:11 -0300 |
|---|---|---|
| committer | andrezgz <andrezgz@gmail.com> | 2019-07-18 08:02:11 -0300 |
| commit | 9c83202be700db822481d04e23de619aa9113815 (patch) | |
| tree | 0ff6787909d150e365f9475f2091139903cb2f63 /challenge-010/andrezgz | |
| parent | 1b28f6a10620b3c4f8812ef0d80073be63a4803e (diff) | |
| download | perlweeklychallenge-club-9c83202be700db822481d04e23de619aa9113815.tar.gz perlweeklychallenge-club-9c83202be700db822481d04e23de619aa9113815.tar.bz2 perlweeklychallenge-club-9c83202be700db822481d04e23de619aa9113815.zip | |
challenge-010 andrezgz minor fix for ch-1
Diffstat (limited to 'challenge-010/andrezgz')
| -rw-r--r-- | challenge-010/andrezgz/perl5/ch-1.pl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/challenge-010/andrezgz/perl5/ch-1.pl b/challenge-010/andrezgz/perl5/ch-1.pl index beed25baaf..a1cfa3ca7d 100644 --- a/challenge-010/andrezgz/perl5/ch-1.pl +++ b/challenge-010/andrezgz/perl5/ch-1.pl @@ -44,14 +44,14 @@ exit 0; # Subtractive notation roman number validation sub _is_valid_roman { - return $arg =~ / - ^ # String start - M{0,3} # Matching from 1000 to 3000 - (?:CM|CD|D|D?C{0,3})? # Matching from 100 to 900 - (?:XC|XL|L|L?X{0,3})? # Matching from 10 to 90 - (?:IX|IV|V|V?I{0,3})? # Matching from 1 to 9 - $ # String end - /xi; + return $_[0] =~ / + ^ # String start + M{0,3} # Matching from 1000 to 3000 + (?:CM|CD|D|D?C{0,3})? # Matching from 100 to 900 + (?:XC|XL|L|L?X{0,3})? # Matching from 10 to 90 + (?:IX|IV|V|V?I{0,3})? # Matching from 1 to 9 + $ # String end + /xi; } sub encode_roman { |
