How to select only numbers/digits from a string

I have a string
Graciela Gonzalez 14576006 | MGM Resorts International, 76070055

from the above string I just need “76070055”, but I dont want “14576006”

I meant that I just digits right side not left side.

Can someone help me on this??

@ushu
@Nithinkrishna
@Gokul001
@ppr
@Palaniyappan
@Yoichi

first split with “|” then take second one and find digit using
Regular expression to identify numbers only in a given string: '\d’

1 Like

whether I need use is match or matches activity??

Hi,

Another solution:

System.Text.RegularExpressions.Regex.Match(yourString,"\d+",System.Text.RegularExpressions.RegexOptions.RightToLeft)

Regards,

1 Like

or anchored

Assign Activity
strValue = System.Text.RegularExpressions.Regex.Match(YourStringVar, YourPattern).Value

1 Like

1 Like


getting error like
cant assign from type system.Text.RegularExpressions.Match to type system.string in assign activity Assign

Hi,

Sorry, the above lacks Value property. Can you try the following?

System.Text.RegularExpressions.Regex.Match(yourString,"\d+",System.Text.RegularExpressions.RegexOptions.RightToLeft).Value

Regards,

1 Like

At the End of the Expression Add .Value or .Tostring

we would prefer to have topics scoped to only one case as researchers chan more easy find solutions.

Quick dirty pattern:

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