regex - Find pattern in text, Python -
right have includepat = r'^#\s*include\s+"([^"]+)"'
match pattern #include "file.h"
i'm having problems trying correct little. if pattern across 2 lines? so.. #include \ "file.h"
how should go matching that?
edit: sorry guys, more clear, string in quotations anything, not limited file.h
if don't need rid of white space , want match it, have pretty close.
this match #include
plus following white space including new lines, , following word in quotation marks
(#include\s+)"([^"]+)"
Comments
Post a Comment