Bug 15455 - RE unable to match a + character as part of character class
RE unable to match a + character as part of character class
Status: CLOSED DUPLICATE of bug 14954
Product: Regexp
Classification: Unclassified
Component: Other
unspecified
PC Windows XP
: P3 normal (vote)
: ---
Assigned To: Jakarta Notifications Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2002-12-17 20:59 UTC by Calvin Goodrich
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Calvin Goodrich 2002-12-17 20:59:27 UTC
The RE object is unable to match a '+' character when it is part of a 
character class, i.e. [\+\-\*\/\%]. It is able to match '-', '*', '/', and '%' 
just fine. It's even broken when the + is specified as an hex char, as in 
[\x2B\x2D\x2A\x2F\x25], whereas the other characters still match.

Tested against JDK v1.3.1_01 and JDK v1.4.1_01 on the Windows platform.

Test JSP code follows:

<%@ page import="org.apache.regexp.*"%>
<%
  String formula = "1 + 1";
  RE re = new RE ("([\\+\\-\\*\\/\\%])");
  if (re.match (formula)) {
%>
expression matched '<%= re.getParen (1) %>'
<%
  }
%>
Comment 1 Vadim Gritsenko 2003-04-25 12:34:24 UTC

*** This bug has been marked as a duplicate of 14954 ***
Comment 2 Vadim Gritsenko 2003-05-02 01:15:07 UTC
Fixed by Bug #19329