我正在 Jenkins 工作流程(Jenkins ver 1.609.1)中迈出第一步,我需要逐行读取文件,然后在每一行上运行正则表达式。我对正则表达式“分组”类型感兴趣,但是“项目”和“状态”变量(下面的代码)在 Jenkins 中获得空值。任何建议什么是错的以及如何解决它?
def line = readFile (file)
def resultList = line.tokenize()
for(item in resultList ){
(item =~ /(\w+)=(\w+)$/).each { whole, project, status ->
println (whole)
println (project)
println (status)
}
}