in reply to Regex to Truncate URLs Nicely
http://some-shop.com/dir1/dir2/buystuff.cgi?x=1&y=2&z=3
to something like
http://some-shop.com/(...)/buystuff.cgi?x=1&y=2&z=3
and the second regex to remove anything at the end if there is a long query string at the end. But only doing anything if the URL is over 50 chars.(then again I might just use a couple of splits and some concatenation magic instead, but that would depend on what all my data looked like.)
Good Luck.
-enlil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Regex to Truncate URLs Nicely
by Aristotle (Chancellor) on Nov 02, 2002 at 07:48 UTC |