import re
def parse_command(cmd):
result = []
for part in re.split(rb'\s+', cmd):
result.append(re.sub(rb'^(\w+)', lambda p: p[1].lower(), part).decode())
return result
if __name__ == '__main__':
print(parse_command(b'mail from:<hello@a.com> size=512 command=12'))
print(parse_command(b'ehlo x.com'))
To embed this program on your website, copy the following code and paste it into your website's HTML: