I'm trying to match the string iso_schematron_skeleton_for_xslt1.xsl against the regexp ([a-zA-Z|_])?(\w+|_|\.|-)+(@\d{4}-\d{2}-\d{2})?\.yang.
The expected result is false, it should not match.
The problem is that the call to matcher.matches() never returns.
Is this a bug in the Java regexp implementation?
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class HelloWorld{
private static final Pattern YANG_MODULE_RE = Pattern
.compile("([a-zA-Z|_])?(\\w+|_|\\.|-)+(@\\d{4}-\\d{2}-\\d{2})?\\.yang");
public static void main(String []args){
final Matcher matcher = YANG_MODULE_RE.matcher("iso_schematron_skeleton_for_xslt1.xsl");
System.out.println(Boolean.toString( matcher.matches()));
}
}
I'm using:
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-b15)
OpenJDK 64-Bit Server VM (build 25.181-b15, mixed mode)