in reply to A module for creating "sane" URLs from "arbitrary" titles?
# First, downgrade to ASCII chars (or transliterate if possible) @_ = unidecode(@_); for( @_ ) { s/['"]//gi; s/[^a-zA-Z0-9.-]/ /gi; s/\s+/_/g; s/_-_/-/g; s/^_+//g; s/_+$//g; };
You say transliterate but you don't actually use transliterate.
s/['"]//gi;
Since when do the ' and " characters have both upper and lower case representations?
tr/'"//d;
s/[^a-zA-Z0-9.-]/ /gi;
Which characters does the /i option affect here?
tr/a-zA-Z0-9.-/ /c;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: A module for creating "sane" URLs from "arbitrary" titles?
by Corion (Patriarch) on Apr 20, 2012 at 21:40 UTC |