You are viewing limited content. For full access, please sign in.

Question

Question

RegEx to Remove Open Bracket [

asked on May 9, 2018

Hi Everyone,

 

I am OCR'ing some text from inside a table on a page.  Sometimes it picks up an open bracket "[" as part of that.  (Example: [Mountain)  

 

I know you can exclude characters using [^], for example [^M] would return ountain, but how would I exclude the [ itself?

 

0 0

Answer

SELECTED ANSWER
replied on May 9, 2018

You need to escape it to tell the regular expression it's literally the bracket and not the beginning of a range: [^\[] or [^\[\]] if you want to exclude both the opening and closing brackets.

1 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.