<%@ Language=VBScript %> <% 'Always do this: (good programming practice!) Option Explicit 'Declare our variable Dim objRegExpr 'Create an instance of the regexp object Set objRegExpr = New regexp objRegExpr.Pattern = "\([0-9]{3}\)[0-9]{3}-[0-9]{4}" objRegExpr.Global = True objRegExpr.IgnoreCase = True 'What string are we searching on? Dim strSearchOn strSearchOn = "My phone number is (123)654-3211. Sue's phone " & _ "number is (873)392-1222." 'Declare a variable to hold our collection of Matches Dim colMatches 'Now, Execute the regular expression search Set colMatches = objRegExpr.Execute(strSearchOn) Dim objMatch 'Print the # of matches we found Response.Write colMatches.Count & " matches found...<P>" 'Step through our matches For Each objMatch in colMatches Response.Write objMatch.Value & "<BR>" Next 'Clean up Set colMatches = Nothing Set objRegExpr = Nothing %>