Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

EastAsianWidth test.
Hi,
I am running a EastAsianWidth property test on z/OS using perl-5.8.6.

$str = chr(0xA1).chr(0xA2);

if ($str =~ /(\p{EastAsianWidth: A}+)/)
{
print "match";
}
else
{
print "no match";
}

First, is the above regex supposed to mean this : does $str contain chars
one or more of which has a "EastAsianWidth: Ambiguous" property ?

Also, if the regex is changed to /(\p{EastAsianWidth: a}+)/, I dont get a
match either. Is a lowercase 'a' in the regex synonymous with uppercase 'A'
?

The EastAsianWidth.txt mentions that 0xA1 has a property 'A'. So, the above
should match.

Any thoughts are welcome.

Thanks in advance,
Rajarshi.

 ________________________________________
_________________________
News, views and gossip. http://www.msn.co.in/Cinema/ Get it all at MSN
Cinema!


Report this thread to moderator Post Follow-up to this message
Old Post
Rajarshi Das
03-29-05 08:57 AM


Re: EastAsianWidth test.
On Tue, 29 Mar 2005 11:08:05 +0530, Rajarshi Das wrote:
> Hi,
> I am running a EastAsianWidth property test on z/OS using perl-5.8.6.
>
> $str = chr(0xA1).chr(0xA2);
>
> if ($str =~ /(\p{EastAsianWidth: A}+)/)
> {
>      print "match";
> }
> else
> {
>      print "no match";
> }
>

I'm using perl-5.8.6 on Linux and your code prints "match" when I run
it, so it seems to work for me. Check your LANG and LC_* env
variables, are you working in a utf-8 environment? If not, try setting
that, or using "use utf8;" at the beginning of your script.

Hope this helps,
--
Offer Kaye

Report this thread to moderator Post Follow-up to this message
Old Post
Offer Kaye
03-29-05 08:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PERL Beginners archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:49 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.