re = /^[^\S\r\n]+artist:[^\S\r\n]*(.*)/m
str = 'mp3 @ 0x75b225b8]Estimating duration from bitrate, this may be inaccurate
[lavf] stream 0: audio (mp3), -aid 0
[lavf] stream 1: video (mjpeg), -vid 0,
Clip info:
Release date: Songspk.LINK
album_artist: Various Artists
album: Kapoor & Sons (Since 1921)
artist: Tanishk Bagchi, Arijit Singh & Asees Kaur
composer: Amaal Mallik | Songspk.LINK
disc: 1/1
encoded_by: Lame
genre: Bollywood Music
title: Bolna - Songspk.LINK
track: 1/1
EpisodeID: Songspk.LINK
copyright: Songspk.LINK
TOPE: Amaal Mallik | Songspk.LINK
TIT1: Songspk.LINK
TIT3: Songspk.LINK'
# 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