I need to come up with a regular expression with flavor PCRE. It must be a regular expression <
I want to grab all lines of text that end in a newline character up until I encounter <zz>
where zz is a digit enclosed in '<
' and '>
'.
e.g.
111a z
222 aset
333 //+
12 <zz> 11
abc
def
It would need to capture "111a z
", "222 aset
", "333 //+
" in this case [and nothing else].
Right now I have ^(?!.*<zz>)[^\n]+(?=\n)
but it's pretty far off from what it needs to be.
For clarification purposes, the regex I was using shows <zz>
, but definitely looking for a digit enclosed in angle brackets.
Would really appreciate some help.
Edit
This is /really/ difficult for me, because at least one of the answers looks like it does the job. I'll try to mark one... Thank you, everyone.