Объект RegExp

Метасимволы

\d \D

Описание:

\d - цифра. Эквивалентно [0-9].
\D - НЕ цифра. Эквивалентно [^0-9].

Пример:

Set objRegExp = CreateObject("VBScript.RegExp")
objRegExp.Global = True
Str = "WindowsNT Windows2000 Windows98"
objRegExp.Pattern = "Windows\d"
Set objMatches = objRegExp.Execute(Str)
MsgBox objMatches.Count
objRegExp.Pattern = "Windows\D"
Set objMatches = objRegExp.Execute(Str)
MsgBox objMatches.Count

© 2004 http://small.h12.ru