Ok
A bit long-winded this - should be read from the bottom up.
[tt]
s|(.*)/.*$|$1|
^
Marks the end of the replacement expression.
^^
The replacement expression, replaces entire line with what was remembered by the earlier bracketed expresion
^
Terminates the search pattern, starts the replacement expresion.
^
Matches the end of a line
^^
As before, matches any character(s)
^
Matches a / character
^
Marks the end of $1
^^
A search pattern, matching any character(s)
^
Marks the start of a portion of the search pattern that will be remembered to be used later (as $1)
^
Marks the start of the search pattern
^
Means we're doing a search
[/tt]
Mike
Want to get great answers to your Tek-Tips questions? Have a look at faq219-2884
It's like this; even samurai have teddy bears, and even teddy bears get drunk.