Miguel has asked for the wisdom of the Perl Monks concerning the following question:
What am I missing here:
Output:#!/usr/bin/perl -w use strict; # Also tried with this, but with no better results use POSIX qw/locale_h/; setlocale(LC_CTYPE, "pt_PT.ISO8859-1"); my @words = qw/ç q áãç abc/; foreach (@words) { $_ =~/[[:alpha:]]/ ? print "$_ : OK!\n" : print "$_ : NOT OK!\n"; $_ =~/\w+/ ? print "$_ : OK!\n" : print "$_ : NOT OK!\n"; }
Why aren't "ç", "ã" and "á" being recognized as valid alphabetic characters? How can I validate a word containing such characters?ç : NOT OK! ç : NOT OK! q : OK! q : OK! áãç : NOT OK! áãç : NOT OK! abc : OK! abc : OK!
Thank your for your attention,
Miguel
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Matching alphabetic characters
by wazoox (Prior) on Mar 11, 2006 at 17:53 UTC | |
|
Re: Matching alphabetic characters
by wfsp (Abbot) on Mar 11, 2006 at 17:47 UTC | |
|
Re: Matching alphabetic characters
by clinton (Priest) on Mar 12, 2006 at 02:06 UTC |