Remove and replace letters in parameter

I have an instance parameter that is a number prefixed with a Type parameter that is text. I would like to be able to select the element and update the text prefix only when the Type changes without changing the number. I am able to achieve this when one element is selected but not when multiple are selected. I feel I hit a wall. HELP. Thanks in advance.

Have you tried regex from the clockwork package?

I would also recommend using the regex package from clockwork. Be sure to use string nodes so every character is interpreted literally.

For example, a pattern to match all prefixes would be:

\w+ (Matches one or more word character)

And a pattern to match all digits would be:

\d+ (Matches one or more digit character)

Thanks @architectcoding @cgartland ! Regex was the trick. Took me a minute to understand how the node works and the difference between \w+ and \d+. Seems I had the two crossed at first. That one node replaced 12. Thanks again!

Attached is my graph just in case anyone is interested.

1 Like