I've tried this regex on three different "regex generators" online. It works fine. But when I run it on my local machine I get empty arrays as response.
This is my code.
$string = "Testing \$test;";
preg_match_all("/(\$[A-Za-z]*)/", $string, $match);
print_r($match);
Response is:
Array
(
[0] => Array
(
[0] =>
)
[1] => Array
(
[0] =>
)
)
I've tried http://regexr.com/, https://regex101.com/#pcre, http://www.phpliveregex.com/ All work fine.
What is going on? Why is preg_match_all
returning empty values on my machine? How can I debug this?
Thanks in advance