jakarta-regexp-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 3753] New: - RE matches when it shouldn't
Date Thu, 20 Sep 2001 21:07:01 GMT
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=3753>.
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=3753

RE matches when it shouldn't

           Summary: RE matches when it shouldn't
           Product: Regexp
           Version: unspecified
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Other
        AssignedTo: regexp-dev@jakarta.apache.org
        ReportedBy: alexdmiller@yahoo.com


The following sample program return true, but should return false.  Perhaps the 
escaped '.' is being interpreted unescaped and matching the 'x' in the str?

Sample program
--------------
import org.apache.regexp.*;

public class Test { 
  public static void main(String arg[]) {
    try {
      String pattern = ".*\\.";
      String str = ".x";
      RE re = new RE(pattern);
      System.out.println(re.match(str));        // should be false
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}

Mime
View raw message