I am checking file names with a regex.
File names can be format of
customer name - company name
I am using this regex:
private static final Pattern fileRegex = Pattern.compile("^[a-zA-Z0-9_\\-\\.\\s\\,\\[\\]()\\{\\}]+$");
But hypen sign (minus sign) is not working and it is acting like a dash. I am not sure maybe it is because of IntelliJ idea settings. how can I add minus sign to this regex?
For example this format must be valid:
test - test1 − test2
In here first one is just simple dash and the second one is minus sign.