re = /src=(["'])(?<url>(?:https?:)?\/\/(?:(?!\1).)*?)\1/m
str = '<iframe style="border: 1px solid rgba(0, 0, 0, 0.1);" width="800" height="450" src="https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Ffile%2FuZVQhh9JQIziU1cSg3CSne%2FRich-Text-and-Embed-Dev%3Fnode-id%3D101%253A8445" allowfullscreen></iframe>'
# 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