How to remove anything except letters and numbers?

Hey guys,

I have one field like Name:
Then I have another one like: Name2:

I want to get the data that the user typed into Name field, and put it into Name2, but removing anything except letters (e.g.: special characters, spaces).
E.G.: My Special Name @113 will become: MySpecialName113

Thanks!

I’m guessing you’re going to need some regex magic to do this. I’m not experienced enough to know what type of regex magic, but it certainly looks like a use case for it.

1 Like

thank you @andrewgassen. I’ve managed so far to make a replace condition on " " spaces. But I need to figure out the other part. I will look into it. Thanks!

I don’t have access to Bubble at the moment but the following regex should work:

.replace(/[^A-Z0-9]/ig, “”)

1 Like

thank you! I will try it later tonight.

This topic was automatically closed after 70 days. New replies are no longer allowed.