Hi,
I would do it like this:
$test = lc($test); # lowercase normal A-Z
$test =~ tr|ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîíÖÔÒöôòóÜÛÙüûù|aaaaaacceeeeeeeeiiiiiiiooooooouuuuuu|; # convert all utf into a-z
$test =~ s/[^0-9a-z]+/-/gi; # anything that DOESNT match 0-9 or a-z, convert to -
$test =~ s/-+/-/gi; # if we have stuff like --- just replace with -
Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
I would do it like this:
Code:
my $test = "andy íóé foo --- Hey, this is a title! Come & read me =)))"; $test = lc($test); # lowercase normal A-Z
$test =~ tr|ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîíÖÔÒöôòóÜÛÙüûù|aaaaaacceeeeeeeeiiiiiiiooooooouuuuuu|; # convert all utf into a-z
$test =~ s/[^0-9a-z]+/-/gi; # anything that DOESNT match 0-9 or a-z, convert to -
$test =~ s/-+/-/gi; # if we have stuff like --- just replace with -

Cheers
Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!