To escape backslash \ in a regex
string you need
FOUR backslashes.
You need two backslashes in the regex.
You need to escape each backslash in the string = total of four.
Also you need to escape the backslashes with the \r and \n
And do you mean to start with a ^? Because that indicates a logical not - ie all characters EXCEPT what you include in the square brackets.
String escapePattern = "[^\\\\0-9A-Z\\p{Blank}\\r\\n^_`~\\p{Punct}\\[\\]\\{\\}\\|]"
Hope this helps some,
evnafets
[ July 12, 2005: Message edited by: Stefan Evans ]