php - regex: remove all text within "double-quotes" (multiline included) -
i'm having hard time removing text within double-quotes, spread on multiple lines:
$file=file_get_contents('test.html'); $replaced = preg_replace('/"(\n.)+?"/m','', $file);
i want remove text within double-quotes (included). of text within them spread on multiple lines.
i read newlines can \r\n
, \n
well.
try expression:
"[^"]+"
also make sure replace globally (usually g
flag - php rusty check docs).
Comments
Post a Comment