我有一個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