You might also want to add these two to the end: =~ s/--+/-/g; =~ s/-$//g;
Scott McWhirter wrote:
$str =~ s{\W}{}g; $str = lc($str); $str =~ s{\s+}{-}g; -- -Scott McWhirter- | -konobi-On Mon, Dec 15, 2008 at 12:10, Moritz Onken <[email protected] <mailto:[email protected]>> wrote:Hi, I was wondering if anyone has a nice regex or module which modifies a string to look good in an url. You know this behaviour from blogs which make urls from the blog title Example: "Beta Launch Invites: Kwyno Brings The Web Into Your IM And (Soon) SMS Inboxes" -> http://www.techcrunch.com/2008/12/15/beta-launch-invites-kwyno-brings-the-web-into-your-im-and-soon-sms-inboxes/ Any ideas? cheers, moritz
_______________________________________________ List: [email protected] Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
