|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Re: regex not workingby jwkrahn (Prior) |
| on Oct 07, 2011 at 07:54 UTC ( #930140=note: print w/ replies, xml ) | Need Help?? |
|
Well let's see what your program does:
On the first pass you are trying to match '2020' with /[0]{2}/, or in other words with /00/. Since '2020' does not contain the string '00' the program prints false. On the second pass you are trying to match '2020' with /[1]{0}/, or in other words with //. Since '2020' contains five places that will match the program prints true.
The next two follow the same pattern as the first two.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||