I am trying to parse an e-mail reply using regular expressions. My response looks like:
This is my response.
Some text here
?
?
From: Lastname, Firstname
Sent: Saturday, January 05, 2013 7:37 PM
To: Lastname, Firstname
Subject: Some Subject
?
Some Text
I am interested in parsing everything up to the first ?.
I have tried utilizing single line mode with $response =~ /^(.*)\?\n/s;. But that returns me everything up to the last ?. Any help would be appreciated.
.* is greedy. The non-greedy version .*? should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With