I am trying to capture text blocks which start with the header “Sender:” or “From:” and contain the keyword “SOA”.
The original text is
start of original text
Sender:
John Doe
This is an email about Service-Oriented Architecture (SOaaA).
From:Jane Smith
body: This email is unrelated to SOA.
Sender:John Doe
body:none
Sender:Jenny
Let’s learn SOA!
end of original text
I expect to capture 2 groups as,
Group-1
From:Jane Smith
body: This email is unrelated to SOA.
Group-2
Sender:Jenny
Let’s learn SOA!
My trial
I tried (^(From:|Sender:)(([sS])SOA)?)(?!(From:|Sender:)) but cant’ have good result.
Any suggestions?
Thanks in advance!
Samuel
Hsu Samuel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.