in reply to match only last character of a kind
In general, though, you can do this sort of thing with a regular expression by using a character class that doesn't include the seperator. For example:
will grab everything up to the last slash.if ($path =~ m|^(.*)/[^/]*$|) { $dir = $1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: match only last character of a kind
by duc (Beadle) on Aug 17, 2006 at 19:55 UTC | |
by duc (Beadle) on Aug 17, 2006 at 20:20 UTC |