You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by bu...@apache.org on 2002/02/07 06:17:04 UTC

DO NOT REPLY [Bug 6294] New: - RegularExpression doesn't work with the '?' operator

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=6294>.
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=6294

RegularExpression doesn't work with the '?' operator

           Summary: RegularExpression doesn't work with the '?' operator
           Product: Xerces2-J
           Version: 2.0.0
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Other
        AssignedTo: xerces-j-dev@xml.apache.org
        ReportedBy: eddie@allette.com.au


I've resently tested the RegularExpression package to great extent and noticed 
that the '?' operator doesn't work. From what I can understand the '?' operator 
should make a character or group optional. To illustrate I've used the following 
example:

String text = "dfdfdfdfdfdffddffdffdfffdfdfddfdfdffddffd";
RegularExpression regExpChecker = new RegularExpression("fd?f", "uw");
Match match = new Match();
if (regExpChecker.matches("", 0, text.length(), match)) {
    System.out.println("Got match");
}

Surely there are a couple of matches that fullfil the search condition.

Cheers,
/Eddie

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org