messages =re.split(b'(?:\xff){8}', payload)# Invalid, too many empty elements
print(messages)
messages =re.split(b'(?:(?:\xff){8})+', payload)# Invalid, there are leading empty elements
print(messages)
messages =re.split(b'(?:(?:\xff){8})+',re.sub(b'^(?:(?:\xff){8})+', b'', payload))# Valid, but not best approach with removing the initial delimiters
print(messages)
messages =[x for x inre.split(b'(?:\xff){8}', payload)if x]# Best approach: let the regex do its work, and discarding emoty elements is left for the if