I'm new to coding can anyone help me to convert the below set of text to a dictionary using regex or any other technique.
Bus Number: Departure
, will be common in all messages / blocks
KPN_Sleeper: Bus Number: Departure
Bus code: Kpn-866489 KA-01-7233 Bangalore
AC Sleeper/56 Seats
24 Seats booked
SRS: Bus Number: Departure
Bus code: SRS-5858 KA-31-5985 Bangalore
SAM: Bus Number: Departure
Bus code: SAM-0077 TN-23-0777 Chennai
{0:{
"Bus_name": "KPN_Sleeper",
"Bus code":"Kpn-866489",
"Bus Number": "KA-01-7233",
"Departure": "Bangalore",
"others": "AC Sleeper/56 Seats 24 Seats booked "
},
1:{
"Bus_name": "SRS",
"Bus code":"SRS-5858",
"Bus Number": "KA-31-5985",
"Departure": "Bangalore",
"others": ""
}}
Since I'm new to coding and regex, I'm feeling difficult to construct.