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 15381] New: - bracket expression [046-9] not evaluated correctly, but [6-904] is
Date Sun, 15 Dec 2002 22:13:51 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=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:   <mailto:regexp-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:regexp-dev-help@jakarta.apache.org>


Mime
View raw message