How do I rewrite the following regex expression to include carriage returns and spaces?
mysql_query\("(.*)"\)
It should match the following types of data.
String with carriage returns:
$result = my_mysql_query("
SELECT foo, bar
FROM mytable
ORDER BY name");
String with some carriage returns:
$result = my_mysql_query("SELECT foo, bar
FROM mytable
ORDER BY name");
String with no carriage returns:
$result = my_mysql_query("SELECT foo, bar FROM mytable ORDER BY name");
If you use PCRE (used by PHP’s
preg_*()functions), use thesmodifier so.matches carriage returns and newlines: