> Subject: regular expression
> Date: Wed, 9 Jun 2004 18:46:30 -0500 (CDT)
> From: Mandar Rahurkar <[EMAIL PROTECTED]>
> CC: [EMAIL PROTECTED]
>
> Hi,
> I am looking for URL's that end in .html OR .htm or /
>
> if($URL =~ /[.html$|.htm$|\/$]/) {
> #do somthing
> }
>
> whats wrong with the above expression ?
>
> Mandar
To answer your question, you can not use brackets [ ] in
that context. Brackets are for character classes, so for
instance [html] would look for an 'h' or a 't' or a 'm' or
an 'l'. You might have more luck if you get rid of the
brackets and escape the '.' like this: \ .
Mike
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>