How to escape a square bracket for Pattern compilation?
For some reason, the above answer didn’t work for me. For those like me who come after, here is what I found. I was expecting a single backslash to escape the bracket, however, you must use two if you have the pattern stored in a string. The first backslash escapes the second one into the … Read more