RegEx using Matches Activity

I am using the Matches Activity to find the following pattern using RegEx:

Team A:
line 1: askdfjlasdfkjklsdfj
line 2: jkldsfjlskdjf
line3: asjdfkljasdfklsdjfk

Comment notes: sdakfjasldkfjlskdjf;askdfj;askdjf

Team B:
line 1: askdfjlasdfkjklsdf
line 2: jkldsfjlskdjf
line3: asjdfkljasdfklsdjfk
line 4: sdklfjasdklfj
line 5: akdfjasldfkjdksf

  line 6: sdkfjasldkfjaskdfj


Comment notes: sdakfjasldkfjlskdjf;askdfj;askdjf

What I am trying to do is find a pattern where “Team A: … Comment notes:” matches.

Regex Pattern being used: ^Team [A-Z]:((.)\n)

The Regex Pattern above selects everything. For instance, I want
Match 1: Team A: … Comment notes:
Match 2: Team B: … Comment notes:

What is the best way to do this? Thank you in advance.

Hi,

How about the following pattern?

(?<=^|\n)Team[\s\S]*?Comment notes:

Regards,

Thank you Yoichi! It is what I needed.

What is the purpose of <?

Hi,

(?<= means positive lookbihind assertion. In this case, it means “Team” must be at the beginning of the string or the line.

Regards,

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