LISTING 3: Code That Uses a Regular Expression to Detect Errors Dim regEx, xmlhttp set regEx = New RegExp set xmlhttp = CreateObject("Msxml2.XMLHTTP.3.0") xmlhttp.Open "GET", "http://localhost/November/template/badqueryflat",false xmlhttp.Send() xmltext = xmlhttp.responseText ' The pattern matches SQL PIs. regEx.Pattern = "<\?MSSQLError.*\?>" ' Search all occurrences in the result. regEx.Global = True set Matches = regEx.Execute(xmltext) for each Match in Matches msgbox Match Next