Extract Numeric data from Alpa Numeric string

Team,
I need to extract all numbers of an alpha numeric string, kindly suggest.
str_InputString(data type is String) = “1742cookm”
str_Output(pls specify which data type) - 1742
Thanks in advance.

@prerna.gupta

System.Text.RegularExpressions.Regex.Match(InputString,“\d+”).Value

@prerna.gupta

Hi please use the below regex expression and assign it to a variable and the output variable type must be a string.

System.Text.RegularExpressions.Regex.Match(InputString,"(\d+)").Value

Hope it helps!!

I tried this already but its an Error.
str_Output data type = System.Text.RegularExpression.MatchCollection

@prerna.gupta

The datatype of match is string

Assign str_Output data type to “String”

Datatype of Match ?
str_InputString(data type is String)
str_Output - Can you specify the adta type again ?

@prerna.gupta

Please try the above flow

Regards

@prerna.gupta

Assign str_Output data type to “String”

This worked.
Thanks much for such quick resolution.

1 Like

@prerna.gupta

below is the attached xaml for your reference
Sequence.xaml (8.3 KB)

Hope it helps!!

@prerna.gupta

Thank You

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.