I am trying to create a regex pattern to search for a special kind of file names:
A file name may look like this:
fileName_1x1.extension
I want to find if the filename has this pattern:
_(number)x(number).
I pasted the previous path into an online regex generator/tester and it worked with this pattern:
Pattern pattern = Pattern.compile("_\\d(.+)x\\d(.+)\\.");
Matcher matcher = pattern.matcher("fileName_1x1.extension");
return matcher.find();
Why isn't this working in Java?