I am trying to match list of string that end in .xsd but not in form.xsd I use the following regEx:
ArrayList<String> files = new ArrayList<String>();
files.add("/abadc/asdd/wieur/file1.form.xsd");
files.add("/abadc/asdd/wieur/file2.xsd");
Pattern pattern = Pattern.compile("(?<!form{0,6})\\.xsd$");
for (String file : files) {
Matcher matcher = pattern.matcher(file);
if(matcher.find())
{
System.out.println("Found >>>> "+file);
}
}
I expect file2 to be printed out but i do not get any result. Am i doing something wrong here? I try the same expression in an online java regEx Tester and I get the expected result but I dont get the result in my program.