Malak Sadek Malak Sadek - 19 days ago 9
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
R"((\w+) (\d+), (\d+)(\(\d+\)))"

worked for me