I am having some difficulty trying to create a working regex pattern for recognizing a string of file names.
Pattern pattern = Pattern.compile("(\\w+)(\\.)(t)(x)(t)(\\s$|\\,)");
When using a .find() from a matcher class on my sample input, say
"file1.txt,file2.txt "
I am returned true, which is fine, however other erroneous input also returns true.
This erroneous input includes strings such as:
"file1.txt,,file2.txt "
"file%.text "
I have been consulting this website as I have been trying to construct them, I'm pretty sure I am missing something rather obvious though. Link