in reply to Regexes and URIs

Do you have the complete URI in a single string or do you have it in a text? The first is quite simple:
($file) = $uri =~ /^.*\/(.*)$/;
You might end up with an empty $file if the URI ends in a / (and therefore uses the default index file).

The later is more complicate, for you have to keep different things in mind:

There might be other things that I haven't thought about yet, but I hope you get the image...
--
Alfie