I would like to extract 10.00ML in following byte: b'\x0200S10.00ML\x03' So I've tried extracting the 10.00ML between 200S and \x03:
result = re.search(b'200S(.*)x03', b'\x0200S10.00ML\x03')
which didn't work, no element was found:
AttributeError: 'NoneType' object has no attribute 'group'
Using only strings I have a minimum working example:
test_string = 'a3223b'
result = re.search('a(.*)b', test_string)
print(result.group(1))
x03do not actually appear in that string, that's just part of an escape sequence. You would need the preceding backslash as well.