[Catalyst] create search engine friendly uri from string

Scott McWhirter scott+catalyst at konobi.co.uk
Mon Dec 15 20:16:10 GMT 2008


$str =3D~ s{\W}{}g;
$str =3D lc($str);
$str =3D~ s{\s+}{-}g;


-- =

-Scott McWhirter- | -konobi-

On Mon, Dec 15, 2008 at 12:10, Moritz Onken <onken at houseofdesign.de> 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 (Soo=
n)
> 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: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20081215/6a0a4=
9f4/attachment.htm


More information about the Catalyst mailing list