Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
^(?P<opcode>[a-zA-Z]+)(?P<byte_mode>\.[BbWw])?(?:\s+)(?P<operand_src>[A-Za-z0-9@\(\)]+)(?:(?:,\s*)|(?:\s+))(?P<operand_dst>[A-Za-z0-9@\(\)]+)
"
gm

Description

Match double-argument assembler instructions, extracting opcode, operand_src, and operand_dst

Submitted by Sam Wagenaar - 2 years ago