Please consider the following input string:
X=Y
Z=U
Q=PLorem Ipsum is simply dummy text of the printing and typesetting industry.
Lorem Ipsum has been the industry's standard dummy text ever since the 1500s
I'm wondering if it's possible capture the following with a regex one liner:
left: X
right: Y
left: Z
right: U
left: Q
right: P
text: Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text
ever since the 1500s
The idea is that there's a bunch of lines that have a specific format followed by a "\r\n" and some text after that. I want to capture each of the key value pairs (in this example) and the text separately.
Capturing the structured data is easy enough (and just an example here):
(?:^(?<left>\S+)=(?<right>\S)\n)
But I cannot figure out how to specify something like:
"Keep capturing this pattern until the first empty line, after that take everything and capture it to "text".
It's easy enough to solve this problem using code, but I'm really interested in learning if it's even possible with nothing but a Regex one liner.