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

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

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

html - jQuery UI Sortable - Remove placeholder after item is dropped -