Regex To P1

Hi everyone i am getting the input like this and in this i need to only out as after the P1

001P1123456 002Y123456 003*P178901 0000+025FT00000987 XYZ TechSolutions Ltd

Output : 123456,78901

By using regex?

HI @Kevin_S

You can try this way it will work

1 Like

Thanku for quick reply @Praveen_Mudhiraj

But i need full regex expression because Iā€™m not using the matches activity

For single match you can use this

System.Text.RegularExpressions.Regex.Match(str_InPut,"(?<=P1)\d+").Value.Trim

for group matches you can use this and based on index you can call it

System.Text.RegularExpressions.Regex.Matches(str_InPut,"(?<=P1)\d+")

Hope It will help for you

@Kevin_S

1 Like

Hi,

Hope the following sample helps you.

mc = System.Text.RegularExpressions.Regex.Matches(yourString,"(?<=P1)\w+")

Sample20230928-1aL.zip (2.6 KB)

Regards,

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