Hi Daniweb.
I'm using a file mask (eg '*.txt') to filter filenames in a program that I'm writing.
It gets the file mask from an .xml settings file.
Currently the mask is '*.xml', and the code I'm using to filter this is like this:
Pattern.matches(fileMask, fileName);
The exception that is thrown (at that line) is the following:
Exception in thread "Thread-0" java.util.regex.PatternSyntaxException: Dangling meta character '*' near index 0
*.txt
^
'fileMask', when I print it out, has been assigned th following value: "*.xml" (minus the quotes, ofc)
Does anyone have an idea what I can do to solve this problem? Please let me know if more clarity on the problem is required.