RegEx - capture all before first occurence of (

trying to capture everything before first occurence of ( in

  • name (temp)
  • name alt (temp1) (temp2)

this is not working in DO
RegExS(name, "^([^\(]*)", "\1");

but does work at
RegExr: Learn, Build, & Test RegEx
regex101: build, test, and debug regex
etc...

Well,
I have this working.

I'll have to think more about your syntax.
This doesn't mean I think you are wrong.

Your regex is fine. It doesn't seem to work because RegExS replaces the capture group with itself, see:

RegExS(name, "^([^\(]*)", "ABC")

Many thanks :slight_smile: