On 15.12.2008, at 21:22, Jim Spath wrote: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;
My not very elegant, but working solution:my $str = " Beta Launch Invites: Kwyno Brings The Web Into Your IM And (Soon) SMS Inboxes ";
$str =~ s/^\s+|\s+$//g;
$str =~ s/\W/ /g;
$str =~ s/\s{1,}/ /g;
$str =~ s/\s/-/g;
$str = lc($str);
print "$str\n";
--
Johannes Plunien | mailto:[email protected] | http://www.pqpq.de/contact/
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ 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/
