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 2001/09/20 23:07:01 UTC

DO NOT REPLY [Bug 3753] New: - RE matches when it shouldn't

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();
    }
  }
}