I've stumbled across an interesting bug in PHP. Basically I have a regular expression seen below which works fine in one script (Script A) but fails to work when put into a class and used in a script (Script B).
I have tested this script on PHP 5.3, and 5.2.
Script A:
http://iamdb.googlecode.com/svn/trunk/testing.php
Script B:
Class the regex is used in: http://iamdb.googlecode.com/svn/trunk/imdb/search/imdb_search_title.class.php
Script calling it: http://iamdb.googlecode.com/svn/trunk/examples/Search_Debug.php
Regular Expression:
"#<br> aka <em>\"([^\"]*)\"</em>(?: -?,? ([^ ]*) (?:<em>\(([^\)]*)\)</em>)*)*#i"
Thanks.
As requested, here is some example output from Script B...
Array
(
[0] => Array
(
)
[1] => Array
(
)
[2] => Array
(
)
[3] => Array
(
)
[INPUT] => <small>(TV series)</small> <br>aka <em>"Hammer Time"</em> - USA <em>(working title)</em>
)
The numbered keys are from the preg_match_all call and the INPUT key is added afterwards to show the input string.