I'm just beginning with regex and just got stuck in a difficult situation. The string i have is:
ITEM DESCRIPTION: KING AUTHUR 2LB FLOUR PACK: 10 SIZE: 0011.00 OZ
I need to get the parts within "< >":
ITEM DESCRIPTION: <KING AUTHUR 2LB FLOUR> PACK: <10> SIZE: <0011.00 OZ>
I've tried
: *([\w\.]+ ?[\w]* [\d\w]* *[\w]*)
which is not 100% accurate and feels repetitive and also becomes tedious when the text gets longer (multiple key:value).
Is there a generalized way of getting all the values from a key:value pair from a text of indefinite length?
And also why something like (ITEM).*: doesn't stop at ITEM DESCRIPTION: but selects all the way upto ITEM DESCRIPTION: ... SIZE: if I just want to get the first key?