How to include parentheses inside regex formula as a part of formula in google sheet

Viewed 422

I have a Google sheet where in one column I have text strings. Below is an example of a text string.

We  are  looking  for  a  ".NET  Developer"  who  will  be  working  closely  with  business  analysts  and  team  members  to  understand  business  requirements  that  drive  the  analysis  and  design  of  quality  technical  solutions.salary:9000. We  are  now  preferably  looking  for  Candidates  who  are  all  residing  in  UAE. Please  send  your  CV  to  test@test.com ,with  Subject  title  "Dot  Net  Developers"

I want to format the above text string in next column by giving extra space after certain characters and words. like . : , " / .com job location .ae

I used following formula which is working perfectly for each characters except parentheses. How can I give space before and after parentheses found in text string. ".NET Developer"

=REGEXREPLACE(A2,"(:|/|.com|job location|.ae)","$1 ")
3 Answers

You need to escape the parenthesis by setting a backslash before it eg. \( this will tell the regex that you are looking for the character.

This should find start, end parenthesis and double quotes (:|\/|.com|job location|.ae|\(|\)|\")

I have made a demonstration here

quotes or parentheses ? there is no parentheses in text string. ".NET Developer", so if quotes

=REGEXREPLACE(A2,"(:|/|"&""""&"|.com|job location|.ae)","$1 ")

It works for me:

=REGEXREPLACE(REGEXREPLACE(A2,"(\(|\)|:|/|.com|job location|.ae)"," $1 "), "[\(\)]", " $0 ")

enter image description here

Related