I want to fix a Regex formula, but bumping into a challenge I can not fix.
We have a text field with a product name. This can be:
- The Ultimate Workspace
- The Ultimate Workspace - payment in 3 installments
I want a formula that extracts everything prior to " - …" (including the blank space in front of the hyphen. So the result will be “The Next Level”.
I have tried to make a ReplaceRegex myself. But can’t seem to get the desired outcome.
The result will be 'The Ultimate Workspace", no?
If you are sure that the first hyphen in the string is always the one you want to separate at, then I would suggest the following:
Yes. We use with testing all those products interchangeably so accidentally misnamed.
Only challenge left. We sometimes have ‘The Ultimate Workspace’ and sometimes we have ‘The Ultimate Workspace - payment in 3 installments’.
If I use this formula, ‘The Ultimate Workspace’ will become ‘The Ultimate Workspac’ due to the -1. Tried to modify, but didn’t find the right solution.
You probably need something this then:
Was trying something like this, but because I wasn’t using the find function, my formula came up negative. This is perfect!
Well, it actually can be done simply with regex replace as well.
ReplaceRegex(TextField, "-.*", "")
A post was split to a new topic: Extracting name from text