Regular Expressions 101

Community Patterns

Mips I-Type Instructions

1

Regular Expression
PCRE (PHP <7.3)

/
^\s*(addi|andi|ori)\s*(\$[a-z0-9]{2,4}),\s*(\$[a-z0-9]{2,4}),\s*([0-9]+)\s*$
/
gm

Description

Parses an I-Type Mips instruction. You can add and remove instructions in the list to support more I-Type instructions.

Will detect only "addi", "andi" or "ori" as is

Submitted by lunfel - 9 years ago