Problem with replacing string by regex

Hello,

I have an issue with replacing strings with regex from Clockwork package. When there is two match in a string it creates two different string as an output instead of replacing the matches.
See image attached, it is self-explanatory. Any suggestion appreciated.

@daninet Please post your dyn or a link to it

RegEx.dyn (32.4 KB)
RegEx_test.rvt (336 KB)

Looks like a list @ level issue

Tried the lacings and levels, seen no difference. If you may have time take a look on it in the sample revit I have included.

Thank you

Also, the output of the Number.ToString node is split into two items at index 2. I‘d try to turn that into a multiline string and then experiment with list@level on the second regex node again. Can’t look at your sample since i‘m On a mobile.
Edit: and you might need to turn on multiline matching, too.

The FindRegEx node outputs two elements for index two. It will find the same two item in the replace as well. Logic would say you have to input two element as it will find two so it can replace two.
I don’t really know how would you solve this with a single string.

I see the issue now. It’ll be easier to just take the strings apart entirely, change the numeric values and then glue them back together.


RegExEdited.dyn (38.7 KB)

1 Like