Porting Regex Code

I have some regex code originally written in PHP and I need to port this to ASP. Here is the original PHP code:\[code\]$contents = file_get_contents("http://localhost/source.txt");$title = 'My Title';preg_match("/<b>$title.*?(<p.*?)<\/td/smi",$contents,$matches);print_r($matches);\[/code\]And here is the ASP ported version:\[code\]contents = File_Get_Contents("http://localhost/source.txt")response.write contentstitle = "My Title"regex = "<b>" + title + ".*?(<p.*?)</td"Set objRE2 = New RegExpWith objRE2 .Pattern = regex .IgnoreCase = True .Global = True .MultiLine = TrueEnd WithSet myMatches = objRE2.Execute(contents)'myMatches - Count is 0Function File_Get_Contents(strFile) ' Remote File If Left(strFile, 7) = "http://" Or Left(strFile, 8) = "https://" Then 'Set objXML = Server.CreateObject("Microsoft.XMLHTTP") ' Use this line if above errors Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP") objXML.Open "GET", strFile, False objXML.Send() File_Get_Contents = objXML.ResponseText Set objXML = Nothing ' Local File Else Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(strFile, 1) File_Get_Contents = objFile.ReadAll() Set objFile = Nothing Set objFSO = Nothing End IfEnd Function\[/code\]source.txt:\[code\]<td><b>My Title</b><br><p>My Content</p></td>\[/code\]If I write out the actual regex pattern in both languages, it's the same except for the escaping of the forward slash character in the PHP version. (I've also tested adding this, with the same effect).Is there some subtle difference in the regexes that I am missing or is it some silly mistake I just can't see?Thanks.
 
Top