DOORS DXL 正则表达式 [匹配 0] 不工作
DOORS DXL Regular Expressions [match 0] not working
这个非常基本的程序在 DOORS 9.6.1.6 下 运行 失败:
string t = "Hello World!"
Regexp re = regexp2 ".+([a-z]+!)$"
if(re t){
print "found the " re[match 0]
}
我收到这个错误
-E- DXL: <Line:4> incorrect arguments for ([)
-E- DXL: <Line:4> incorrectly concatenated tokens
-I- DXL: All done. Errors reported: 2. Warnings reported: 0.
知道发生了什么吗?
您正在尝试在正则表达式对象上调用 match
,而您应该将其与字符串一起使用。
修正为
print "found the " t[match 0]
^
这个非常基本的程序在 DOORS 9.6.1.6 下 运行 失败:
string t = "Hello World!"
Regexp re = regexp2 ".+([a-z]+!)$"
if(re t){
print "found the " re[match 0]
}
我收到这个错误
-E- DXL: <Line:4> incorrect arguments for ([)
-E- DXL: <Line:4> incorrectly concatenated tokens
-I- DXL: All done. Errors reported: 2. Warnings reported: 0.
知道发生了什么吗?
您正在尝试在正则表达式对象上调用 match
,而您应该将其与字符串一起使用。
修正为
print "found the " t[match 0]
^