Re: numbers and strings and regex?



Geoff Cox <geoff.cox@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in comp.lang.perl.misc:
> Hello
>
> I have a series of files such as
>
> blue-green-01-01.doc to
> blue-green-01-09
> blue-green-01-11 up to
> blue-green-01-32
>
> and am trying to evaluate the second set of 2 digits using File::Find
> and this bit of code
>
> if ($name =~ /.*?(\d{2})-((\d{1})(\d{1}))\.jmx/i) {

Your pattern requests files that have an extension ".jmx". Your examples
have an extension ".doc" or none. Also, \d{1} is the same as \d.

[snip]

Anno
.



Relevant Pages