in reply to Regex - one and only one / at beginning and end of file path
I got lazy and copped out with the /e for that edge case.. :)s { \A /* ( (?: [^/]+ /+ )*? [^/]* ) /* \z } { length $1 ? "/$1/" : '/' }ex;
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Regex - one and only one / at beginning and end of file path
by CombatSquirrel (Hermit) on Dec 15, 2003 at 07:21 UTC | |
by Aristotle (Chancellor) on Dec 15, 2003 at 08:14 UTC | |
by CombatSquirrel (Hermit) on Dec 15, 2003 at 18:52 UTC | |
by Aristotle (Chancellor) on Dec 15, 2003 at 20:19 UTC |