Malak Sadek Malak Sadek - 1 year ago 84
C++ Question

How to express an assembly lw/sw instruction using regular expression regex library?

I want to detect when the user enters "lw 2, 3(9)" , but it can't read the parenthesis, I used this code but it still doesn't detect the parenthesis.

{ R"((\w+) ([[:digit:]]+), ([[:digit:]]+) (\\([[:digit:]]+\\)) )"}

Can someone please help?

Answer Source
R"((\w+) (\d+), (\d+)(\(\d+\)))"

worked for me

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download