我有一个myRegex函数从字符串中提取正则表达式。当我运行使用该函数的查询时,我在多行上出现以下错误。正则表达式多行选项不被访问识别
未找到方法或数据成员。
这是正则表达式功能:
Function myRegex(ByRef myString As String, ByVal pattern As String) As String
Dim rgx As New RegExp
Dim colMatches As MatchCollection
With rgx
.pattern = pattern
.ignoreCase = True
.Global = False
.Multiline = False
Set colMatches = .Execute(myString)
End With
If colMatches.Count > 0 Then
myRegex = colMatches(0).Value
Else
myRegex = ""
End If
End Function
这是我使用的查询:
SELECT myRegex(phone,"[0-9]+")
FROM table1
我有以下参考库检查:
- 微软的VBScript正则表达式1.0
- 微软的VBScript正则表达式5.5