I have this sentence: "int open(const char *" pathname ", int " flags );
I am trying to find a regex to extract the words outside the double quotes. Example: "pathname" and "flags". I created a regex expression, but it only catches the word "flags" and not the word "pathname". Here is what I have:
reg2 = r"""(\".*\" (.*) )+\);"""
pattern2 = re.compile(reg2)
inner = m.group(1)
m2 = pattern2.search(inner)
EntityI = m2.group(2)
print EntityI
Note: m.group(1) is: "int open(const char *" pathname ", int " flags );
Thanks for the help!
Edit: Just the clarify some more. Another possible case could be:
"int open(const char *" pathname ", int " flags ", mode_t " mode );
And I would want to extract the words: "pathname", "flags", and "mode".