Search code examples
regexgoogle-apps-scriptgoogle-sheetsconditional-formatting

how to add whitespace before certain characters or words in google sheet


I have a google sheet where i have long text string in each cell.

following is one of the text string

VACANCY...Test Hotels is hiring for the below position.#Job_Title : Director of a Revenue/ Revenue Manager#Hotel_Name : Signature Hotel#Job_Location : Dubai#Nationality : Selective#Experience : Mandatory hotel experience#Salary_Range : Unspecified#Benefits : Unspecified- Candidate should be currently in UAE and has relevant UAE Hotel experience.Please specify “Applying Position” in the subject line.Email CV: test@test.com#jobseekers #vacancy #Dubai #jobs #recruiters #hotels #manager #revenue

I want to add white spaces before certain words or character so it look neat . for example i want to add white space before "#", "Salary", " job location" etc.

Ho can i do that


Solution

  • Please be reminded that you have to escape any metacharacter

    =REGEXREPLACE(A1,"(#|Salary|job location)"," $1")