How to get multiple matches in regex?

"Hi Everyone,

I need help with my problem.

Let say I have the string below:

Hi Team,

Please enroll the following devices for Genesis Care DEP ID 1393773.

SH51MM0L20F0N

SH51ML6AN0F0N

SH51MM0GR0F0N

SH51MM0GT0F0N

SH51MM0HV0F0N"

as you can see there are multiple instances that have SH followed by alphanumeric characters.

my goal is to extract all of it using regex.

is the possible?

hope someone can give me a hand on this

Regards

1 Like

Hi @alvin.c.apostol26

You can use the below regex ecpression:
^SH[A-Z0-9]+

Use the above regular expression in Find Matching Patterns activity. In options keep Compiled, IgnoreCase and MultiLine and stroe the output in a avriable say Matches.

Run a For Each Loop for Matches and print the values.

Hope it helps!!

@alvin.c.apostol26

SH\d+[A-Z]+\d+.*

image

Use Find Matching Pattern Activity to get the IEnumerable of matches and then use For each

Hi @Parvathy,

For some reason it’s not highlighting in Regex Builder

I already selected the properties below:

image

Regards

@alvin.c.apostol26


Please try my expression

Thank you this worked for me!

Hi @alvin.c.apostol26

My expression will also work. Check the output once.

Output:
image

Regards

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