I have the following code
$pattern = '#\bset_message\("(.*?)"\)#';
$found = preg_match($pattern, $string, $matches);
But if my $string is
set_message("Hello there
I like
to
eat
CHEES!");
it doesn’t return anything for matches, but it does if I use
set_message("Hello there!");
how can I add new lines and stuff like that (\r\n, \n, etc)?
Just use
mmodifier.When you want that
.could mean\nalso, you need to use bothm' ands` modifiers: