the match-method on RE class work incorrectly if the lower bound in the {n,m} notation have the value of 0 for n and n<m. I wrote this test programm to check the erro: import org.apache.regexp.RE; public class test { public static void main(String args[]) { try { test re = new test(); re.test(); } catch(Exception e) { } } public void test() throws Exception { String[] exprV = {"ab{0,1}","ab{1}"}; String[] matchV = {"a","aa","aba","abba"}; boolean matched; RE r; System.out.println("expr \tmatch \tMatches"); for (int i=0; i<exprV.length;i++) { r = new RE(exprV[i]); for (int j=0; j<matchV.length; j++) { matched = r.match(matchV[j]); System.out.println(exprV[i]+"\t"+matchV[j]+"\t"+matched); } } } } the result was expr match Matches ab{0,1} a false <--- must be true! ab{0,1} aa false <--- must be true! ab{0,1} aba true ab{0,1} abba true ab{1} a false ab{1} aa false ab{1} aba true ab{1} abba true I got these results with Linux and java version 1.3.1_01.
Fixed by patch attached to bug #19329 *** This bug has been marked as a duplicate of 19329 ***
Fixed by Bug #19329
*** Bug 22035 has been marked as a duplicate of this bug. ***