Why am I not getting the same behavior when I build a Pattern from a literal regular expression and when I read the regular expression from a file?
String regex = "(?xi)(title)[\\.:;](.*) \043 Title property";
Pattern pattern = Pattern.compile(regex);
System.out.println(pattern);
// will print:
(?xi)(title)[.:;](.*) # Title property
This expression works yet when I attempt to read the regular expression from a file I encounter an issue. The '\043' isn't replaced to its proper form. Why so?
I'm trying to avoid the use of the literal '#' character symbol and thereby use and alternative representation of it because of other conflicts in my code.