;------------------------------------------------------------------------------------------------------------------------------------------ #DefineFunction udfStrSplitWords (strString, strDelimiter) objRegExp = ObjectCreate ("VBScript.RegExp") objRegExp.Pattern = "[\s{}()\[\]:;.,""'`\\]+|$" ; \s is equivalent to "[ \f\n\r\t\v]". objRegExp.IgnoreCase = @FALSE objRegExp.Global = @TRUE objRegExp.MultiLine = @FALSE strList = "" intPos = 1 objMatches = objRegExp.Execute(strString) ForEach objMatch In objMatches intPosMatch = objMatch.FirstIndex + 1 If intPosMatch > intPos Then strList = strList : strDelimiter : StrSub (strString, intPos, intPosMatch - intPos) intPos = intPosMatch + objMatch.Length Next DropWild ("obj*") Return StrSub (strList, 2, -1) ; Detlev Dalitz.20090620. #EndFunction ;------------------------------------------------------------------------------------------------------------------------------------------ ; Test. strString = " :This is" : @TAB : "a(test)" : @CRLF : "string" strDelimiter = @LF strListWords = udfStrSplitWords (strString, strDelimiter) arrListWords = Arrayize (strListWords, strDelimiter) strMsgTitle = "Demo: udfStrSplitWords (strString, strDelimiter)" strMsgText = strString : @LF : @LF : strListWords Message (strMsgTitle, strMsgText) Exit ;.......................................................................................................................................... ; Example ; ; DisplayUI(hWndParent, Title, TypeOfUI[, ExtraData]) ; ; DisplayUI ; hWndParent ; Title ; TypeOfUI ; ExtraData ;..........................................................................................................................................