I got lazy and copped out with the /e for that edge case.. :)s { \A /* ( (?: [^/]+ /+ )*? [^/]* ) /* \z } { length $1 ? "/$1/" : '/' }ex;
Makeshifts last the longest.
In reply to Re: Regex - one and only one / at beginning and end of file path
by Aristotle
in thread Regex - one and only one / at beginning and end of file path
by mikedshelton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |