Posix char classes broken
This: public static void main(String[] args) { System.out.println(new Perl5Util().match(/[:digit:]/, 1)); System.out.println(new Perl5Util().match(/[0-9]/, 1)); } produces: false true on System.out. It's a bug, no? thnx, adam Adam Shackleford
RE: Posix char classes broken
Eek! I deserve a thousand lashes with my copy of Mastering Regular Expressions for that one! I think RegExp (which I'm switching from) allows inline [:posix:], which is definitely wrong. thanks, a -Original Message- From: Daniel F. Savarese [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 12, 2001 1:07 PM To: [EMAIL PROTECTED] Subject: Re: Posix char classes broken System.out.println(new Perl5Util().match(/[:digit:]/, 1)); I think what you want is [[:digit:]] The POSIX class needs to appear inside of a character class. daniel
new Perl5Util().match(/[[:alpha:]]/, a) = false
The expression: new Perl5Util().match(/[[:alpha:]]/, a) returns false with ORO 2.0.3, whereas: new Perl5Util().match(/[[:alnum:]]/, a) returns true. I hope this isn't another newbie mistake... thanks, adam