<% Function ExtractBetweenStrings(str, strLeftBound, strRightBound) Dim nLeft, nRight nLeft = InStr(str, strLeftBound) nRight = InStr(str, strRightBound) ExtractBetweenStrings = Mid(str, nLeft+Len(strLeftBound), nRight-nLeft-Len(strLeftBound) ) End Function Function ExtractAfterString(str, strRightBound) Dim nRight nRight = InStr(str, strRightBound) ExtractAfterString = Right(str, Len(str)-(nRight+Len(strRightBound)-1) ) End Function Function ExtractBeforeString(str, strRightBound) Dim nRight nRight = InStr(str, strRightBound) If nRight < 1 Then nRight = 1 ExtractBeforeString = Left(str, nRight-1 ) End Function ' Returns true if prefix is the first n characters of bigStr where ' n is the length of prefix Function StringStartsWith( bigStr, prefix ) Dim substring substring = Left( bigStr, Len( prefix) ) StringStartsWith = StrComp( substring, prefix ) = 0 End Function Function ExtractTokenStartingWith( bigStr, prefix ) ExtractTokenStartingWith = prefix + ExtractAfterString( bigStr, prefix ) If InStr( ExtractTokenStartingWith, " " ) >= 1 Then ExtractTokenStartingWith = ExtractBeforeString( ExtractTokenStartingWith, " " ) End If End Function %>