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/15 23:13:51 UTC

DO NOT REPLY [Bug 15381] New: - bracket expression [046-9] not evaluated correctly, but [6-904] is

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

bracket expression [046-9] not evaluated correctly, but [6-904] is

           Summary: bracket expression [046-9] not evaluated correctly, but
                    [6-904] is
           Product: Regexp
           Version: unspecified
          Platform: PC
        OS/Version: Other
            Status: NEW
          Severity: Minor
          Priority: Other
         Component: Other
        AssignedTo: regexp-dev@jakarta.apache.org
        ReportedBy: ulf@dedio.de


Following testprogram:

package test;

import org.apache.regexp.*;

public class Test {

	private static void test(String regularExpression, String string) 
throws RESyntaxException {
			RE re = new RE(regularExpression);
			System.out.println(regularExpression + " matched " + 
string + ": " + re.match(string));
	}

	public static void main(String args[]) {
		try {
			test("[046-9][0-9]{9}","4083245501");
			test("[6-904][0-9]{9}","4083245501");
			test("[046-9][0-9]{8}","4083245501");
		}
		catch (Throwable e) {
			e.printStackTrace(System.err);
		}
	}
}

first test should result true, but results false.
second test results correctly true.
third test results true, but should be false, as the string has 10 digits.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>