Extract specific text from string

Hi Everyone,

I have a specific string as present below

This the id of number PIQ : 3453724 AFR : 344544 please login to activate.

I just wanted to extract PIQ : 3453724 from above string.

Any leads or any good suggestion will be appreciated.

Regards,
Sahil Garg

1 Like

HI @Sahil_Garg1

Use the Regex expression

With PIQ
System.Text.RegularExpressions.Regex.Match(yourString,“PIQ :\s\d+”).Tostring

Without PIQ
System.Text.RegularExpressions.Regex.Match(yourString,"(?<=PIQ :\s)\d+").Tostring

Regards
Gokul

1 Like

Hi,

Just wanted to confirm , Regex.match will return that string ?

Yes @Sahil_Garg1

Match → Return String
Matches → Return Enumerable Value

Regards
Gokul

1 Like
1 Like

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