I am trying to build a regex pattern in UI Path to help me select a block of text from a text file. The file has multiple reports in it in a block format with report types.
Following is an example
REPORT: ABC
Detail Line 1
Detail Line 2
REPORT: ABC
Detail Line 3
Detail Line 4
Detail Line 5
REPORT: ABC
Detail Line 6
Detail Line 7
REPORT: XYZ
Detail Line 1
Detail Line 2
Using the above example I need the following text extracted.
REPORT: ABC
Detail Line 1
Detail Line 2
REPORT: ABC
Detail Line 3
Detail Line 4
Detail Line 5
REPORT: ABC
Detail Line 6
Detail Line 7
So basically the regex pattern should start from REPORT: ABC and extract until REPORT: ABC is not found.
Thanks for the reply. The regex expression works but only if there are no more report types for example if there is one more report type after XYZ, like
REPORT: DEF
Detail Line 1
Detail line 2
Then the expression takes REPORT : XYZ block also.