in reply to regex help

Alright

$a =~ s|/browse(/.*/)|$1|i; $a = $1;

That seems to work :), but what if the url conatins '\' instead of '/' like how could I check for both.

Replies are listed 'Best First'.
Re: Re: regex help
by fglock (Vicar) on Sep 28, 2002 at 05:07 UTC

    '\' or '/' is written like tihs:

    [\\\/] or: [\/\\] so you get: $a =~ s|[\/\\]browse([\/\\].*[\/\\])|$1|i;