I have to extract each string between 2 other strings which are “REASON FOR LEAVING” and “ABC COMPANY” but the thing giving me trouble is the 2 other strings repeat. I need to get each string between each repeating 2 strings. How can I accomplish this out of something like below?
SALARY
DUTIES
REASON FOR LEAVING
FROM (MM/DD/YY)
HOURS PER WEEK
SALARY
DUTIES
REASON FOR LEAVING
BECAUSE OF SOME TEST REASON
BECAUSE OF SOME TEST REASON ABC COMPANY HUMAN RESOURCES
EXAMINATION / EMPLOYMENT
SALARY
DUTIES
REASON FOR LEAVING
DIFFERENT TEST REASON
FROM (M/D/Y)
SALARY
DUTIES
REASON FOR LEAVING
ANOTHER TEST REASON
ANOTHER TEST REASON ABC COMPANY HUMAN RESOURCES
Hi Steve, thanks for replying. The output I’m expecting is to add each string found to a List strExtract for later use as shown below:
strExtract1:
BECAUSE OF SOME TEST REASON
BECAUSE OF SOME TEST REASON
strExtract2:
ANOTHER TEST REASON
ANOTHER TEST REASON
Thank you so much for this regex help Steven. I couldn’t view the file you attached, it just wouldn’t open for some reason. But I will try to implement the regex from the link you attached and I’ll check out the MEGAPOST too and let you know how it works out for me.
Step 4: (See image below)
Click into the ‘Result’ field into the properties panel of the matches activity (see the red circle in the top right). Press ‘Ctrl + K’ can call it ‘Matches_Results’.
Step 5:
Insert a ‘For Each’ activity (Green circle).
Step 6:
Insert the variables ‘Matches_Results’ into the For each.
Step 7:
Insert a log message (Purple circle) with the text exactly
"Result: "+currentItem.ToString