I have a Column called Series and in that column there is two names, Trading [FPTS], and Trading [FPTG). I'm trying to get just the FPTS and FPTG into that column so I can join it with another set of data. Everytime I use text to columns and I can't get rid of the [ , ], ). Any ideas would be greatly appreciated.
Solved! Go to Solution.
try the following formula:
Regex_replace([Series], "Trading [\[\(](.*?)[\]\)]", "$1")
Output should be FPTS or FPTG
That worked for one but no the other. I wrote the question wrong one is Trading and the other is Trading1 sorry.
A looser expression would be:
Regex_replace([Series], ".*?[\[\(](.*?)[\]\)].*", "$1")
This will match text between brackets and extract that
To explain the Regex:
- .*? is a non greedy capture upto a [ or ( bracket '[\[\(]
- Next it captures again non greedy until the next ] or) into $1
- Finally matches rest of like