I'm trying to fetch three fields from some text using regex. The value of fields that I'm after are PLAN,TITLE and REFERENCE. I can extract the value of REFERENCE but I'm stuck with the other two fields. How can I get the value of PLAN and TITLE using regex?
I've tried with (it gives me the reference number):
import re
item_str = """
S
PLAN SHORT TITLE
0030 278 592 0420091;16 052 400 228
REFERENCE: 042 420 626
"""
ref = re.findall(r"REFERENCE:\s+(.*)",item_str)[0]
print(ref)