re = /^\[[^]]+\]: builds\/app\/(.+?)\.(ipa|apk)$/m
str = '[14:54:35]: [32m-------------------------------------------------[0m
[14:54:35]: [32m--- Step: Switch to android upload_to_s3 lane ---[0m
[14:54:35]: [32m-------------------------------------------------[0m
[14:54:35]: Cruising over to lane \'android upload_to_s3\' 🚖
[14:54:37]: builds/app/oneoff/android/22.26.2_15_225877//app-oneoff-release.apk
[14:54:37]: Cruising back to lane \'android build_oneoff\' 🚘'
# Print the match result
str.match(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