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+)"([^"]+)" 

example


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -