I have data like the following which I wish to process using a regular expression:
So i use the following:
temp1 = re.compile('\s*KEYWORD1\s+(\S+)')
temp2 = re.compile('\s*KEYWORD2\s+(\S+)')
Using this its straight forward to extract and store the VARIABLE_1 to VARIABLE_4, however I sometimes have the following structure
KEYWORD1 [1_OR_MORE_NUMBERS:0] VARIABLE_5;
KEYWORD1 [1_OR_MORE_NUMBERS:0] VARIABLE_6;
I can't seem to devise a regular expression that nicely extracts and stores all the variables - any thoughts?