Open Whatsapp with number added

Hi there, new to Text Blaze and loving it so far. I'm having difficulty with a regex expression (who doesn't); I want a phone number to be the input in a form (probably will be to paste from clipboard) and then open whatsapp. So in a browser, I would invoke the automation from the url-line (in my case using /wavtc) and then the result should be "wa.me/xxxxxxxxxxx". I tried myself, and also asked the AI to create something, where this is the result:

Enter your phone number: {formtext: name=phone_number}

Normalized phone number: {=replaceregex(phone_number, "[^\d]+", "")}

The only thing is that this doesn't remove spaces where I absolutely need the spaces to be removed.
What am I doing wrong here?
Thanks for support,
Boudewijn

Hi, @boudewijn, welcome to the forums! :slight_smile:

The function replaceregex replaces only one occurrence by default, that's why spaces are not removed unless they appear at the beginning of the text. To replace all occurrences, please use the global flag "g" as the third parameter, like this:

Enter your phone number: {formtext: name=phone_number}

Normalized phone number: {=replaceregex(phone_number, "[^\d]+", "", "g")}