I got strange behaviour from apache.commons.lang3:3.9
(but everything is ok in 3.5).
I use RandomStringUtils.random
to generate string with length 350. And it matches regex (that has 300 limit).
I can't see any special symbols generated in this string. And string.length() is 350.
public class RegexCheck {
private String VALUE_REGEXP = "^.{1,300}$";
private String value= RandomStringUtils.random(350);
public void run(){
System.out.println(value);
System.out.println("string length is " + value.length());
if(value.matches(VALUE_REGEXP)){
System.out.println(">>>>>>>>match");
}else{
System.out.println(">>>>>>>>don't match");
}
}
}
CodePoints in value:
for lang3:3.9: codePointCount is 197. for lang3:3.5: codePointCount is 293. This values may vary from run-to-run.