in reply to Regular expressions across multiple lines
How long are the actual strings that are represented by 'abc' and 'def' in your problem description? What are the real strings?