I have the following string:
EUID=000000;GTIME=503551082,+0;KEY=034534D9D1644C0B27404283D04B78B9B31BA143D80ABDF8781FE45D8246B92;IV=9B3112343D80ABDF8781FE45D8246B92;GPOS=+00000.0000,+00000.0000;
I would like to extract each value between an =
and a ;
.
I've tried the following: d_block = (the string above)
import re
re_euid = re.search('EUID=(.*);', d_block)
euid = re_euid.group(1)
re_gtime = re.search('GTIME=(.*),', d_block)
gtime = re_gtime.group(1)
re_tzone = re.search(',(.*);', gtime)
tzone = re_tzone.group(1)
re_key = re.search('KEY=(.*);', d_block)
key = re_key.group(1).upper()
re_iv = re.search('IV=(.*);', d_block)
iv = re_iv.group(1)
re_gpos = re.search('GPOS=(.*);', d_block)
gpos = re_gtime.group(1)
For some reason...Each value is returning more than it should. It's not stopping at the ;
as I'd like.
Example of current data returned for euid:
000000;GTIME=503551082,+0;KEY=0061ECAD9D1644C0B27404283D04B78B9B31BA143D80ABDF8781FE45D8246B92;IV=9B31BA143D80ABDF8781FE45D8246B92;GPOS=+00000.0000,+00000.0000
Which is the whole string except for the EUID=
.