I have a script that is supposed to extract a date from the name of a series of files, in YYMMDD format. It uses the RegExp object. It works perfectly on my Win 2000 machine at home, but when I brought it into work, I found that I couldn&#039;t reference the Matches collection by its index number (objDate(0).value). Instead, I could only use the collection syntax (For Each). My first thought was that we must be running IIS4 here, but a quick check of the server variables reveals that it&#039;s IIS5.<BR><BR>I suppose I can work around this, (there will only be one date, so the collection loop will still return the value), but I&#039;d like to know what is causing this.<BR><BR>Function dateTest(data)<BR> <BR> Dim objRegEx, objDate, strDate<BR> <BR> dateTest = ""<BR> <BR> Set objRegEx = New RegExp<BR> objRegEx.Global = False<BR> <BR> &#039;Test for 8 consecutive digits, optionally beginning with non-digit, followed by non-digit<BR> &#039;E.G. matches 20010503.htm, playlist20010503.htm, but not 200105043 or 200105043.htm<BR> objRegEx.Pattern = "^D*d{8}D"<BR> <BR> &#039;Return nothing if pattern not found<BR> If Not objRegEx.Test(data) Then Exit Function<BR> <BR> &#039;Extract 8 digits<BR> objRegEx.Pattern = "d{8}"<BR> <BR> &#039;If test succeeded, there must be at least one occurence, so return date<BR> Set objDate = objRegEx.Execute(data)<BR> <BR> &#039;Assume only one occurrence of pattern, return first one<BR> strDate = objDate(0).Value<BR> <BR> &#039;Return nothing if found string is not valid date<BR> If Not isDate(Left(strDate, 4) & "/" & Mid(strDate, 5, 2) & "/" & Right(strDate, 2)) Then Exit Function<BR> <BR> dateTest = strDate<BR> <BR>End Function<BR><BR>Response.Write dateTest("playlist20010203.htm")