I am trying to replace “ “ and “/” in this column with “_” . How do I frame the regular expression and replacement text?
hi @MosesAddai24
I just tried to replace any white space and slash signs using: [\s\/] in Regular Expression with "_". It should work.
Karolina
Hello @MosesAddai24,
The images you posted aren't already doing that? The Original Header(State) seems to have, for example, the text "2 3", and you're replacing the text.
If not, if your data is composed of digits and words, you can use ([\w\d]+)[\s\/]([\w\d]+)
This will:
1. ([\w\d]+) - Group any combination of words and digits
2. [\s\/] - Check if theres a spacebar of a slash
3. ([\w\d]+) - Group again any combination of words and digits
Then for the replacement, just use "$1_$2"
Hope this helps!
Hi @MosesAddai24
This is a Non-Regex way that uses formula to achieve the same goal. Hope it helps. Cheers!
I tried it and got an error that says " " cannot be found. How do solve the error?
When I used that I got **_** throughout that column. Do I have to change something in the code?
It worked! Thank you !
@JoaoLeiteVFYI - \w includes \d already so no need to check for both...
Thanks for the tip @apathetichell! I'll keep that in mind.