Skip to main content
Solved

Using RegexReplace()

  • Jul 22, 2025 5:53 PM UTC
  • 0 replies
  • 403 views

Mez
Forum|alt.badge.img+7
  • Qrew Colonel

Does this function support capturing groups, and if yes, how does one access the captured data? 

Intent is to use a this function looking for punctuation from a text field, and then add a new line to this. 

regex: ([.!?])\s*

substitution: $1\n

Documentation doesn't state one way or the other. I've tried escaping the new line value without success. Perhaps I'm just missing something simple. 

Best answer by Mez

Found the solution: capturing is referred to with backslash 1, which needs to be escaped. 

RegexReplace( [Additional Notes], "([.!?])\\s*", "\\1\n" )

 

View original

Forum|alt.badge.img+6
  • Qrew Member
  • Jul 22, 2025 7:32 PM UTC

Can you give an example of the before and after results you are looking for?


Mez
Forum|alt.badge.img+7
  • Author
  • Qrew Colonel
  • Aug 1, 2025 4:31 PM UTC

Posting this again. 

Found the solution: capturing is referred to with backslash 1, which needs to be escaped.

RegexReplace( [Additional Notes], "([.!?])\\s*", "\\1\n" )