Removing Excess " -" Using Regex

Hi all,

I’m trying to remove additional " -" from a word formula (which combines multiple fields with hypens in between). Since some of the fields can be blank, the word formula produces outputs of the following format :

word - - - word - - word - -

and I’m trying to get remove the excess to hypens to get:

word - word - word

I currently have the text formula

regexReplace({Conference Display Field}, (^\s-)|(\s-$) , )

where (as a start) I’m trying to remove the start " -" and the end " -" but this formula doesn’t seem to change the text at all…

Any help would be greatly appreciated.

Hey @HarryR

Have you tried asking ChatGPT :wink:

Ahaha I gave it a go but I think Knack’s compatibility with Regex is the problem here. It’s not behaving at all how expeceted.

1 Like