Skip to main content
Solved

StringReplacer RegEx duplicates output (bug?)

  • February 3, 2020
  • 3 replies
  • 14 views

Forum|alt.badge.img

Hi all,

 

 

I have something weird going on in my StringReplacer.

E.g. a simple string goes in.

 

StringReplacer settings:

 

RegEx captures whole string in capture group 1, then as a replacement I use capture group 1, followed by the string "finished"

 

 

In the output the string "finished" is somehow duplicated.

 

Magic / bug / am I doing something wrong?

 

Cheers,

 

Ed

 

Best answer by ebygomm

I'd try altering your regex to (.+) - one or more rather than zero or more

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • Best Answer
  • February 3, 2020

I'd try altering your regex to (.+) - one or more rather than zero or more


Forum|alt.badge.img
  • Author
  • 60 replies
  • February 3, 2020

I'd try altering your regex to (.+) - one or more rather than zero or more

That worked, thank you.

 

 

But why? I don't get it.

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3427 replies
  • February 3, 2020

That worked, thank you.

 

 

But why? I don't get it.

Each occurrence of the match is replaced, since your regex matched with nothing, the nothing also got replaced with nothing and the text specified