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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -