Bug 30126

Summary: Error on negating certain predefined character classes (\W\S\D)
Product: Regexp Reporter: Klaus Lechner <klauslechner>
Component: OtherAssignee: Jakarta Notifications Mailing List <notifications>
Status: CLOSED FIXED    
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   

Description Klaus Lechner 2004-07-15 15:42:08 UTC
This occured with jakarta-regexp-1.3 (final) on WinXP using j2sdk 1.4.2.

Trying to compile regular expressions using the negated character classes \W,
\S\ or \D causes, on execution:

org.apache.regexp.RESyntaxException: Syntax error: Bad character class

Even the simplest possible example fails:
RE re = new RE("[^\\W]");

It works though with \w, \s or \d.
Comment 1 Vadim Gritsenko 2005-08-12 22:46:05 UTC
Implemented support for [\W] and [^\W] etc.