[Reactive Utilities] [Reactive Utilities] Regex_Replace not working

Forge Component
(13)
Published on 2019-12-05 by Miguel Vicente
13 votes
Published on 2019-12-05 by Miguel Vicente

Hi guys,

I'm trying to use the Regex_Replace action but isn't working.

I want to remove all the non numeric characters of a string. The pattern that I'm using is "/[^0-9]/g" and replace "".

What I'm doing wrong?

I'm using the SS version 10.0.1008.0.


Thanks in advance.

Kind Regards,

Diogo Miguel 

Hi Diogo,


try: 

SyntaxEditor Code Snippet

"[0-9]+"


Hi Thiago

Thanks for your feedback.

I tried your pattern but its also not working. I think that its a bug of the version of the platform we are using.


Kind Regards,

Diogo Miguel

Thats weird...


In my test, i did this steps:

1 - I created an input for digit a text and associate a variable called Txt;

2 - I created an expression showing an another variable called TextRegex;

3 - I created a button called an server action. In this action i have a regex_replece, with:

     Text: My variable called Txt; Pattern: "[0-9]+"; Replace: ""
And then i have an assign: The variable TextRegex = Regex_Replace.Result.


Maybe these steps can help you.

Hi Thiago

I solved with the following pattern:

SyntaxEditor Code Snippet

"/[^0-9]/g"


Thanks for your help.

Regards,

Diogo Miguel

Diogo Miguel wrote:

Hi Thiago

I solved with the following pattern:

SyntaxEditor Code Snippet

"/[^0-9]/g"


Thanks for your help.

Regards,

Diogo Miguel

Great! Tnks for sharing your solution.