What potential issue can arise when using the preg_match_all function with multi-line patterns?

When using the preg_match_all function with multi-line patterns, the dot (.) metacharacter does not match newline characters by default. This can cause issues when trying to match patterns that span multiple lines. To solve this, you can use the "s" modifier in the regular expression pattern, which allows the dot metacharacter to match newline characters as well.

// Example code snippet
$string = "Line 1\nLine 2\nLine 3";
$pattern = '/Line.*$/s';
preg_match_all($pattern, $string, $matches);

print_r($matches[0]);