Gossamer Forum
Quote Reply
Re: [Robert] Regex Help In reply to
Hi,

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 -


Angelic

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!
Subject Author Views Date
Thread Regex Help Robert 5411 Oct 13, 2017, 4:13 AM
Thread Re: [Robert] Regex Help
Robert 5288 Oct 13, 2017, 4:42 AM
Post Re: [Robert] Regex Help
el noe 5271 Oct 13, 2017, 5:23 AM
Thread Re: [Robert] Regex Help
Andy 5269 Oct 13, 2017, 8:56 AM
Thread Re: [Andy] Regex Help
Robert 5267 Oct 13, 2017, 9:06 AM
Post Re: [Robert] Regex Help
Robert 4859 Dec 9, 2017, 2:57 PM