ultranerds has asked for the wisdom of the Perl Monks concerning the following question:
($hit is a hash from earlier on in my code ) If I change $_ to "un" (i.e just normal letters), then the regex works absolutly perfect. However, with the accented charachters, it screws up - and doesn't do the search + replace. NB: I've also been recommended to use: use locale; ...from another forum - but that doesn't seem to fix it for me :( Also, another important note - it seems that this:$_ => été $desc => "test 123 un été à Tanger. élargir elargir ete" $desc =~ s|\b\Q$_|<a href="$hit->{LinkURL}" title="$hit->{TheText}" ta +rget="$hit->{Target}">$_</a>|sg;
i.e starts with a normal char, is absolutly fine - and it works with that - but just not with words where they start with accented charachters :( I've been recommended to you guys, as apparantly you're the best of the best <G> Anyone got any suggestions?$_ => téé $desc => "test 123 un été à Tanger. élargir elargir téé"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Annoying Regex issue with foreign chars
by moritz (Cardinal) on Nov 05, 2008 at 08:05 UTC | |
|
Re: Annoying Regex issue with forign chars
by GrandFather (Saint) on Nov 05, 2008 at 08:15 UTC | |
by ultranerds (Hermit) on Nov 05, 2008 at 12:06 UTC | |
by ultranerds (Hermit) on Nov 05, 2008 at 12:12 UTC | |
by ultranerds (Hermit) on Nov 05, 2008 at 12:21 UTC | |
by ultranerds (Hermit) on Nov 05, 2008 at 14:41 UTC |