One way that won't break depending on the encoding of your source (.pl) file is:
use HTML::Entities qw( decode_entities ); # It is technically possible for Uuml to # be encountered in French, but I don't # know of any words that use it. my @french_accents = map decode_entities("&$_;"), map +($_, lc), qw( Acirc Agrave Eacute Ecirc Egrave Euml Icirc Iuml Ocirc Ugrave Uuml Ccedil AElig OElig ); my $french_accents = join '', @french_accents; $form_values{$field} =~ /[^A-Za-z0-9_'-\.\s$french_accents]/) {
Tested.
Note: Don't forget to decode the value placed in $form_values{$field}.
Update: Added Ocirc. Should Ucirc be on that list? It's been so long since I've written in French.
In reply to Re: Character class for French chars with accents in regex?
by ikegami
in thread Character class for French chars with accents in regex?
by punch_card_don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |