如何从字符串中提取子字符串作为Ruby中的字段名称?使用正则表达式在Ruby中提取子字符串
输出示例:
A-field:name.23.134 => 6
ruby {
code => "
if key =~ /^A-field:[A-Za-z]+/ then
#how to get the match pattern ?and the field value ?
end
}
如何获得匹配图案作为字段ANME和字段值, 过滤后,它的将是貌似
A-字段:名称=> 6