You are viewing a plain text version of this content. The canonical link for it is here.
Posted to regexp-dev@jakarta.apache.org by bu...@apache.org on 2002/12/17 21:59:28 UTC
DO NOT REPLY [Bug 15455] New: -
RE unable to match a + character as part of character class
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15455>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=15455
RE unable to match a + character as part of character class
Summary: RE unable to match a + character as part of character
class
Product: Regexp
Version: unspecified
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: Normal
Priority: Other
Component: Other
AssignedTo: regexp-dev@jakarta.apache.org
ReportedBy: calvin.goodrich@oracle.com
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) %>'
<%
}
%>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>