Okay, what's the [2] doing? It appears to be saying to
match \d exactly two times, but I thought that would
be {2} instead. But changing your [] to {} leads to
the same problem as the original expression.

You probably know, Camilo, but since you didn't say,
let me guess at why Rafael's original RE did not work.
The problem seemed to be the use of "*" (zero or more)
when "+" (one or more) was probably meant. So the
original RE was asking if there are any ocurrences of
*ZERO OR MORE* characters followed by two digits and
the string ".html". The answer is yes, the substring
"01.html" of "djavan001.html" fits that criteria, as
it is ZERO characters followed by two digits, etc.
Changing the "*" to a "+" makes his original RE work
as intended, so there has to be at least one
character. This also prevents something like "99.html"
from matching, which I'm assuming from his description
is also desired.

--- Camilo Gonzalez <[EMAIL PROTECTED]>
wrote:
> Try /[a-z]*\d[2]/
> 
> -----Original Message-----
> From: Rafael Cotta [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, May 07, 2002 12:16 PM
> To: [EMAIL PROTECTED]
> Subject: Matching string (here I am again)
> 
> 
> First of all, special thanks to Drieux.
> 
> I need to check if a string with the following
> patern:
> 
> <lowercase characters><number><number>.html
> 
> Like "cae01.html" or "djavan10.html" (without
> quotes).
> 
> I tryied
> 
> $musica =~ /([a-z]*)[0-9][0-9]\.html/
> 
> but this matches "djavan001.html", when this should
> not.
> 
> Wich regexpr can I use? This time a link to a howto
> will be very welcome,
> once this is not the unique regexpr I'll need to
> build myself.
> 
> Rafael


__________________________________________________
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to