Help on matches

i am using activity find matches pattern its giving correct first match

but how to get the seond match and others

Hi @manoj_verma1
Try to give output in for each loop

HI @manoj_verma1

You can try with Matches in the Regular expression

System.Text.RegularExpressions.Regex.Matches("Yourstring","Pattern")(0)

You can Increment the Values in the expression like (1) , (2)

Or

You can try with For Each activity

Regards
Gokul

Hi @manoj_verma1

The output of the matches will be stored as a collection. Use for each activity to iterate the collection variable. Then you get the all matches

Hope it helps!!

@Gokul001 @lrtetala @mkankatala
what will be the regex for this
B-123Q00001234

Hi @manoj_verma1

Will you provide the total string and which part have to extract as output.

@manoj_verma1
Can you provide total string

@lrtetala @mkankatala I AM reading a pdf file and need to extract some data from that

Hi @manoj_verma1

Can you provide whole string?

Here is Regular expression

System.Text.RegularExpressions.Regex.Match("Yourstring","[A-Z0-9-]+").Tostring

image

Regards
Gokul

@manoj_verma1

If the format of the string is same then use [A-Z]-\d{3}[A-Z]\d{8}

Cheers

Hello @manoj_verma1 ,
Try this Regex pattern

[A-Za-z]{1,4}\-\d{2,4}[A-Za-z]{1,4}\d{5,10}

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