re = /:?(\d+:\d+;)+\d+::/
str = '[04:04:55] Morpheus Deathbrew > is this okay? it\'s cap stable <url=fitting:11978:14240;1:2032;1:31366;1:1447;2:2281;1:31952;1:14136;1:31378;1:2104;1:3608;4:12058;1:2488;6:29001;6::>He Dead :(</url>
[04:04:55] Morpheus Deathbrew > is this okay? it\'s cap stable <url=fitting:11978:14240;1:2032;1:31366;1:1447;2:2281;1:31952;1:14136;1:31378;1:2104;1:3608;4:12058;1:2488;6:29001;6::>He Dead :(</url>
Character Name > <url=fitting:11978:14240;1:31366;1:1447;2:31952;1:14136;1:31378;1:2104;2:3608;4:12058;1:31932;1:2488;6:29001;5::>He Dead :(</url> asdf asefase 351235125
'
# 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