What potential issues can arise when using the .* wildcard in regular expressions in PHP?

Using the .* wildcard in regular expressions in PHP can lead to "greedy" matching, where the pattern matches more text than intended. To solve this issue, you can make the wildcard non-greedy by adding a "?" after it (.*?). This will ensure that the wildcard matches the smallest possible amount of text.

$string = "Hello, World!";
$pattern = "/H.*?o/";
preg_match($pattern, $string, $matches);
echo $matches[0]; // Output: "Hello"