Sihal has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks,
My first problem is that I would like to match stuff as "é", "à", you know, all this accentuated characters we frog-eaters use ;-)
Well, I can't seem to find the character classes for these.
Here is my two tries, condensed in the same regex:
/^[-'\.\s\w\p{IsWord}\p{IsL}\p{InLatinExtended-A}]+$/
Moreover, and more surprising, this regex causes the following error:
nvalid [] range "d-A" in regexp at
Thanks a lot for the help

Replies are listed 'Best First'.
Re: 2 problems withs regexes and letters like é
by Fletch (Bishop) on Jan 16, 2003 at 18:01 UTC

    I don't know if this specifically addresses your problem, but check out perldoc perllocale for information on POSIX locale support in perl. I'm pretty sure it covers on how the locale setting interacts with character classes and what not.

      It seems (I'm not through reading the manpage yet but I start to have a good idea of what is going on) that this will solve my problem. Thanks a lot.
      # Solution for matching "é" use locale ; my $test = "é é é é " ; $test =~ /[[:alpha:]]/ and print "YEAH" ; #OR $test =~ /[\w]/ and print "Thanx" ;
      Simple for some, hard for me since I didn't even knew of localization.

      Thank you Fletch! ( and diotalevi and jdporter who answered in the CB. )
      Ill have a look thanx. Not coming from a computer science, I wasn't aware of locale POSIX