Hi,
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?
Hi SupermanPunch,
Thanx! I have tried indeed, no luck. If I input the string manually like: “text (”“Agreement”") text ", to get the quotation marks inside the string, I am able to remove it by either regex or replace as you propose. But once it’s the activit generated string, it is not working.
Hi ppr,
this is the clue, I have followed the same path and found that the apostrophes generated via OCR are not unicode char 34 but u8220 and u8221, which I have no idea how to generate via keyboard and could not be fetched directly by Chr(8220), so I finished with something crazy like: