Hello, I have a string that can take numbers simbols etc... For example:
1231asdnk123-.as1and I want to take only the numbers like this
12311231
I know that we can use regex to come to this.
The thing is, that it seems that all regex i make in RegEx_Search only returns the first pattern that comes... In this case the return would be 1231, but I need to join them all
Hi Ricardo,
You can use the Regex_Replace action from the Text API (Text Extension) to fulfill your goal:
What it does is replace every non-digit character with the empty string, thus leaving you with only the numeric symbols.
Hope it helps!
This was perfect! I was using Regex_Search, but this is exacly what I needed.Thanks for the help! :)
You have the Regex How-To forge component which not only allows to play with regex in its sandbox, it also provides a few common scenarios like the one you mention.
You just need to do remove all that is different than a number, or replace it by nothing, like in the example above.
Kind Regards,João
You can use the method .replace method like in the image below:
Hope it helps,
Best regards,
Ricardo