读书人

种模块里添加match类型出错用户定义

发布时间: 2012-12-14 10:33:07 作者: rapoo

类模块里添加match类型出错,用户定义类型未定义(高手Help)?
在过程中定义没有问题,不知道错误的原因。

Private Sub Class_Initialize()

End Sub

Private Sub Class_Terminate()

End Sub

'match的m始终改成大小写
Public Function TryGetMatch(ByVal text As String, ByVal pat As String, ByRef m As match) As bool
Dim re As RegExp

Dim matches As MatchCollection

Set re = New RegExp
re.Global = True
re.IgnoreCase = True
re.Pattern = pat

Set matches = re.Execute(text)

If matches.Count <> 0 Then
m = matches(0)
TryGetMatch = True
Else
TryGetMatch = False
End If

End Function

[最优解释]
Public Function TryGetMatch(ByVal text As String, ByVal pat As String, ByRef m As String) As bool
[其他解释]
你好,我是想把m输出为正则Match类型,怎么就不行了啊
引用:
Public Function TryGetMatch(ByVal text As String, ByVal pat As String, ByRef m As String) As bool

读书人网 >VB

热点推荐