ISALPHA

F

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
 
J

J. Gleixner

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.
 
J

John W. Krahn

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
 
J

John W. Krahn

Glenn said:
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
 
B

Ben Morrow

Quoth (e-mail address removed):
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top