I need some help with a pattern match that involves returning multiple lines of text. Here is one example of text
You Sold :
AMCAP FUND CLASS F-1 Trade Date:
Process Date:
Settlement Date:
Cusip:
Symbol:AMPFX
The text that I need returned is AMCAP FUND CLASS F-1. I created a pattern match that captures everything before Trade Date and I used (.*) [Trade Date:] and this gave me the desired result until I came across this 2nd example
You Bought :
BGF GLOBAL MULTI ASSET INCOME FUND CLASS D2 (USD)
(OFFSHORE) Trade Date:
Process Date:
Settlement Date:
Cusip:
In this case I would need to capture BGF GLOBAL MULTI ASSET INCOME FUND CLASS D2 (USD)
(OFFSHORE). My regular expression would need to identify everything before Trade Date and the previous line, or I would need a regular expression that can identify everything in between You Bought: or You Sold: and Trade Date:, but I am not sure how to do a pattern match spans multiple lines of text.
Thanks!