以下是什么是正则表达式:
APPLICATION_CONTEXT.getBean("giisParameterFacadeService")
giisParameterFacadeService
的部分是动态的。
我已经尝试过:
"APPLICATION_CONTEXT[.]getBean[(]""\s*""[)]"
但它不会返回任何内容。
编辑:将其更改为:\ w *
后发生错误行:15。字符:8。错误:无效的过程调用或参数。码。 800A0005
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set file = objFSO.OpenTextFile("sample.txt" , ForReading)
Const ForReading = 1
Dim re
Set re = new regexp
re.Pattern = "APPLICATION_CONTEXT[.]getBean[(]""\w*""[)]"
re.IgnoreCase = True
re.Global = True
Dim line
Do Until file.AtEndOfStream
line = file.ReadLine
For Each m In re.Execute(line)
Wscript.Echo m.Submatches(0)
Next
Loop
答案 0 :(得分:1)
其他选项(已测试here):
APPLICATION_CONTEXT\.getBean\(\"(.*)\"\)
答案 1 :(得分:0)
试试这个:
APPLICATION_CONTEXT\.getBean[(]""\w*""[)]"