re = /\"tag\"\:\"(?<image>([^\/]+\/){2})(?<service>[^\/]+)\/(?<id>[^\"]+)/
str = '{"line":"[ERROR ] CWWKG0031E: The value jdbc/actionateDB specified for unique attribute jndiName is already in use.","source":"stderr","tag":"itec-artifactory.dis.com:6555/com.dis.pl000123.demo.actionate:0.0.1-25/Actionate_DEV_ACTIONATE.1.5tv4m4ckohx526muwvkcyo0v6/a078f70a8338"}
{"line":"[WARNING ] CWWKG0076W: The previous configuration for jndiReferenceEntry with id customDataSourceFactoryEntry is still in use.","source":"stdout","tag":"itec-artifactory.dis.com:6555/com.dis.pl000123.demo.actionate:0.0.1-25/Actionate_DEV_ACTIONATE.1.5tv4m4ckohx526muwvkcyo0v6/a078f70a8338"}
{"line":"","source":"stdout","tag":"itec-artifactory.dis.com:6555/com.dis.pl000123.demo.actionate:0.0.1-25/Actionate_DEV_ACTIONATE.1.5tv4m4ckohx526muwvkcyo0v6/a078f70a8338"}
{"line":"++ dirname /config/configDropins/defaults/keystore.xml","source":"stderr","tag":"itec-artifactory.dis.com:6555/com.dis.pl000123.demo.actionate:0.0.1-25/Actionate_DEV_ACTIONATE.1.5tv4m4ckohx526muwvkcyo0v6/a078f70a8338"}'
# Print the match result
str.scan(re) do |match|
puts match.to_s
end
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Ruby, please visit: http://ruby-doc.org/core-2.2.0/Regexp.html