* Konrad Schulz [04 Dec 2002 16:12]: > Hello all together,
> I got another problem for regexps. I would like to compare two urls in a
> scalar ignoring cases which works fine with the following
> $url1 =~ /m/$url2(\/)?/i
> But as soon as I got a URL with a query it is not working at all!
As you say, metacharacters.
So, escaping with \Q leads to ( $url1 =~ /^\Q$url2\E$/i );
Or just compare lowercase versions:
( lc $url1 eq lc $url2 )
which is much simpler.
[...]
cheers,
--
Iain.
