-1

i have an input on this form "asic = 0x125s45, 0x352s6d8" i am using this regex to capture the first "0xaaaa" then the second "0xbbb" in different groups:

regex = r"=\s*(0x((.*)+)),\s*(0x((.*)+))"
matches = re.finditer(regex, answer[1], re.MULTILINE)

for match in matches: etc... My question is: is there a way to not have a consecutive regex to capture the matchs in different groups? like only have regex = r"=\s*(0x((.*)+))+"or sth like this? without having the repet it twice

0 Answers0