Paul Denning wrote: > Can someone provide a regexp for the last path component? The following Perl-compatible regexp seems to do the trick: /^ [^\#\?]* # Stuff at front (ignore) \/([^\/]+)\/? # Last path component (\?.*)? # Query string (ignore) (\#.*)? # Fragment (ignore) $/x Use the first sub-pattern match as the tag. -- Toby A Inkster <mailto:mail at tobyinkster.co.uk> <http://tobyinkster.co.uk>