How to map "FileNew" to "FileNewABC", which is the value from f_var and returns true?
newfilename = Pattern.compile("FileNew").matcher(f_var).matches();
It always returns false.
You need to use find or try to match all input with a pattern.
find
The match method attempts to match the entire input sequence with the pattern.
The lookAt method tries to match the input sequence, starting from the beginning, with the template.
The search method scans the input sequence, looking for the next subsequence that matches the pattern.