Hey guys I'm parsing a bunch of data from an html file in PHP using the preg_match_all($pattern, $htmlPage, $matches)
method (regular expressions) and am having some issues creating the pattern for the following string: href="http://www.free-tv-video-online.me/player/putlocker.php?id=12VT1372H42OKWGKW" target="_blank"><div>TV Show Season 2 Episode 1
.
The pattern consists of two strings with a wildcard string in the middle. This should be fairly simple but I am having trouble escaping the proper characters in the strings on either side of wildcard string. Here is an example of a pattern I have tried.
//Pattern escaping " and < charecters
$patern = "/href=\"http://www.free-tv-video-online.me/player/.*\" target=\"_blank\">\<div>TV Show Season 2 Episode 1/";
I have tried a couple other patterns but all failed. In all attempts I use the regular expression .*
to signify the wildcard string. What is the correct pattern to parse all occurrences of this string out of an HTML file?