当我在电子表格中按 ctrl-f 时,我可以找到文本“儿童支持”,但是当我将它用作模式时它会失败。其他明显的词也有效,例如“日期”。
此电子表格是从 PDF 转换而来的。是否有一些隐藏的空字符导致该列被忽略?
Private Function RegExTest(s As String) As String
Dim re, match
Set re = CreateObject("vbscript.regexp")
re.Pattern = "(child support)"
re.Global = True
For Each match In re.Execute(s)
MsgBox match.value
RegExDate = match.value
Exit For
Next
Set re = Nothing
End Function