re = /\/*.mkv/
str = 'folder.jpg
metadata
Stargate SG-1 S01E01-E02 Children of the Gods.mkv
Stargate SG-1 S01E03 The Enemy Within.mkv
Stargate SG-1 S01E04 Emancipation.mkv
Stargate SG-1 S01E05 The Broca Divide.mkv
Stargate SG-1 S01E06 The First Commandment.mkv
Stargate SG-1 S01E07 Cold Lazarus.mkv
Stargate SG-1 S01E08 The Nox.mkv
Stargate SG-1 S01E09 Brief Candle.mkv
Stargate SG-1 S01E10 Thor\'s Hammer.mkv
Stargate SG-1 S01E11 The Torment of Tantalus.mkv
Stargate SG-1 S01E12 Bloodlines.mkv
Stargate SG-1 S01E13 Fire and Water.mkv
Stargate SG-1 S01E14 Hathor.mkv
Stargate SG-1 S01E15 Singularity.mkv
Stargate SG-1 S01E16 Cor-Ai.mkv
Stargate SG-1 S01E17 Enigma.mkv
Stargate SG-1 S01E18 Solitudes.mkv
Stargate SG-1 S01E19 Tin Man.mkv
Stargate SG-1 S01E20 There But For the Grace of God.mkv
Stargate SG-1 S01E21 Politics (1).mkv
Stargate SG-1 S01E22 Within the Serpent\'s Grasp (2).mkv
'
# 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