Replace non alpha-numeric characters?

Just wondering how to replace non-alpha numeric characters from a string - basically sanitizing the string.

I know how to do it in Python using:

a = re.sub('\W+', r, s)

but I want to do it without Python, just with Grasshopper.

There is the Replace Text component, but you can’t replace multiple different characters, it only does one at a time and then outputting the string multiple times.

Any ideas?

Hi

Maybe like this, using Replace Members :point_down:?

2 Likes