I got stuck at the following regex issue: I am OCR reading a document and using part of the read text as a new file name, thus have to remove all invalid characters, if any.
The String variable from OCR looks like: Var = “NON-DISCLOSURE AGREEMENT\r(“Agreement”)\r\a” and I need to remove the quotation marks surrounding word Agreement, but cannot make it. The escape characters work fine.
I am using regex.replace(Var, “\r|\a|”"", " “), and its variations like [”"] but could not make it work on apostrophes. Any ideas how to tackle this?
Thanx and regards