in reply to Re: Short URL?
in thread Short URL?
Update The updated regex works unless the URL is exactly 53 characters long. In that case I believe bobafifi wants the URL to stay the same (although I could be wrong). Here is one that (as far as I can tell) works for any length...
$url =~ s/^(.{35})(?=.{19}).+(.{15})$/$1...$2/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Short URL?
by bart (Canon) on Apr 06, 2003 at 10:46 UTC | |
|
Re: Re: Re: Short URL?
by caedes (Pilgrim) on Apr 06, 2003 at 02:18 UTC |