str
=
"
010-65321478 13116782417
"
dim regEx
Set regEx = New RegExp
regEx.Pattern = "/ d{11} "
regEx.Global = true ' 全部匹配
str = regEx.Replace(str, " 手机 " )
regEx.Pattern = "/ d{3}-/d{8} "
str = regEx.Replace(str, " 座机 " )
msgbox (str)
dim regEx
Set regEx = New RegExp
regEx.Pattern = "/ d{11} "
regEx.Global = true ' 全部匹配
str = regEx.Replace(str, " 手机 " )
regEx.Pattern = "/ d{3}-/d{8} "
str = regEx.Replace(str, " 座机 " )
msgbox (str)
VB6中如要使用正则,请先引用: Microsoft VBScript Regular Expressions