I have the next issue here. I'm trying to fetch a string between two HTML comment tags with preg_match/preg_match_all but the result I'm getting is empty array with a lot of records.
Here's my code:
$pattern = "/\<!-- Start of NewsTicker --\>(.*)\<!-- End of NewsTicker --\>/";
preg_match_all($pattern, $description , $matches);
The regular expression pattern itself seems to be valid since it works for me when I put just a short sample string (like: "123456") between two tags within $description variable.
However on the real life content it doesn't work and my guess is that this happens because of the content's length.
Here is the example of the real case the preg_match fails for me: http://www.phpliveregex.com/p/6oJ
Could anyone explain please how the issue could be solved? It's always possible to play with simple string functions like strpos, substr and etc. but isn't there other better options?
Thank you very much!