ISALPHA

ISALPHA

am 09.10.2007 20:50:39 von fred78980

To take into account words with accent I wrote this while ($txt =~ /
\p{IsAlpha}/); The script does not give error message but it doesn't
work.
Your help is appreciated

Thanks

Re: ISALPHA

am 09.10.2007 21:39:39 von glex_no-spam

fred78980@yahoo.com wrote:
> To take into account words with accent I wrote this while ($txt =~ /
> \p{IsAlpha}/); The script does not give error message but it doesn't
> work.
> Your help is appreciated

There isn't an error, so how do you know it didn't
"work". Post a short and complete example showing the issue.

Re: ISALPHA

am 09.10.2007 22:06:47 von Dummy

fred78980@yahoo.com wrote:
> To take into account words with accent I wrote this while ($txt =~ /
> \p{IsAlpha}/); The script does not give error message but it doesn't
> work.
> Your help is appreciated

perldoc perllocale


John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Re: ISALPHA

am 09.10.2007 22:19:10 von Glenn Jackman

At 2007-10-09 02:50PM, "fred78980@yahoo.com" wrote:
> To take into account words with accent I wrote this while ($txt =~ /
> \p{IsAlpha}/); The script does not give error message but it doesn't
> work.
> Your help is appreciated

I don't see "IsAlpha" in the perlunicode man page. Perhaps you want
"Letter" or "Alphabetic" instead.

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry

Re: ISALPHA

am 09.10.2007 22:32:09 von Dummy

Glenn Jackman wrote:
> At 2007-10-09 02:50PM, "fred78980@yahoo.com" wrote:
>> To take into account words with accent I wrote this while ($txt =~ /
>> \p{IsAlpha}/); The script does not give error message but it doesn't
>> work.
>> Your help is appreciated
>
> I don't see "IsAlpha" in the perlunicode man page. Perhaps you want
> "Letter" or "Alphabetic" instead.

perldoc perlre

[ SNIP ]

The following equivalences to Unicode \p{} constructs and equivalent
backslash character classes (if available), will hold:

[:...:] \p{...} backslash

alpha IsAlpha




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Re: ISALPHA

am 09.10.2007 22:35:11 von Ben Morrow

Quoth krahnj@telus.net:
> fred78980@yahoo.com wrote:
> > To take into account words with accent I wrote this while ($txt =~ /
> > \p{IsAlpha}/); The script does not give error message but it doesn't
> > work.
> > Your help is appreciated
>
> perldoc perllocale

No. \p is a Unicodeism; locales and Unicode do not play well together
under current versions of perl. The locale-friendly version would be

use bytes; # just for good measure
use locale;

$txt =~ /[[:alpha:]]/;

Ben