YNY
Full Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору Provides simple regular expression support. Remarks The following code illustrates the use of the RegExp object: Function RegExpTest(patrn, strng) Dim regEx, Match, Matches ' Create variable. Set regEx = New RegExp ' Create a regular expression. regEx.Pattern = patrn ' Set pattern. regEx.IgnoreCase = True ' Set case insensitivity. regEx.Global = True ' Set global applicability. Set Matches = regEx.Execute(strng) ' Execute search. For Each Match in Matches ' Iterate Matches collection. RetStr = RetStr & "Match found at position " RetStr = RetStr & Match.FirstIndex & ". Match Value is '" RetStr = RetStr & Match.Value & "'." & vbCRLF Next RegExpTest = RetStr End Function MsgBox(RegExpTest("is.", "IS1 is2 IS3 is4")) | Всего записей: 476 | Зарегистр. 18-05-2006 | Отправлено: 13:37 28-08-2009 | Исправлено: YNY, 13:55 28-08-2009 |
|