in reply to need to split URL string

If your only interest is in the home_dir, why bother capturing any of the text preceding it? You can use /([^/]*)$/ to capture all text following the last / character if that's all you're looking for. (Note: Regex not actually tested and may contain typos.)

Replies are listed 'Best First'.
Re^2: need to split URL string
by ww (Archbishop) on Feb 09, 2007 at 01:53 UTC
    Close, but as you appear to have suspected, there is a typo, which can be dealt with this way:
    m%([^/]*)$%)

    In your original, the forward slash inside the stock delimiters terminates the regex you offered, meaning that has an unmatched "["