in reply to Re: R.Exp. Matching from the Right
in thread R.Exp. Matching from the Right

This one worked great, but can you explain a little how it is doing it? Thanks a lot you all!

Replies are listed 'Best First'.
Re^3: R.Exp. Matching from the Right
by ikegami (Patriarch) on Feb 23, 2006 at 18:39 UTC
    It reads as /, followed by one or more characters which aren't /, followed by the end of string. It works because of backtracking. When it can't find a match with the first slash (because there are other slashes between it and the end of string), it tries starting at a different slash. Rinse and repeat until a match is found, or there are no more slashes at which to start.