Extract text after number of special characters

Hi everyone

I have some string as below… i need to extract four number after “…XXX”


The result : 1234, 2341, 1111

How to define number of “X” more than 3 character then will extract four number after it.

Thanks you!


We can get them using Matches activity with the following pattern


If your target number exists at the end of the line, the following also works.

Pattern : "\d{4}$"
RegexOptions : Multiline


1 Like

I have used this command but it still do some step : left(System.Text.RegularExpressions.Regex.Match(MyString.ToString,”(XXX).*(\d)”).ToString.Replace(“X”,“”).Trim,4)

How to do regex it only with one step

Thanks you bro!

1 Like

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