For parse, tokenise, ect. the regex tool passes through the group matched.
However with replace it replaces everything that matches and seems to ignore groups.
Why is this, is there a way around this? I believe the formula tool replace does replace based on groups. Any insight is greatly appreciated!
Thanks,
Ira
Solved! Go to Solution.
As you've left your 'Replacement Text' blank, it'll just replace the whole pattern with nothing, regardless of groups. If you want to reference capture groups and have them included in the output then you can do so as usual with '$1' etc.
Thanks @DataNath is it possible to just replace the captured group with nothing in your example?
I think you'd just want to change the expression in that case @IraWatt - I think the only reason you'd need to include capture groups when replacing is if you want to reference any of them in the actual replacement text. If you just want to get rid of it then I'd just have the one pattern as the expression.
That makes sense thanks @DataNath 👍
Ah thanks @binuacs not how I would have considered doing it, I'm not used to the $ syntax so this helps!