Skip to content

Instantly share code, notes, and snippets.

@Haumer
Created September 14, 2020 16:03
Show Gist options
  • Select an option

  • Save Haumer/39fa229fe2a359d9c72414b264df9402 to your computer and use it in GitHub Desktop.

Select an option

Save Haumer/39fa229fe2a359d9c72414b264df9402 to your computer and use it in GitHub Desktop.
something.gsub(/src=(?<url>[^\s]+)/, 'src="" data-src=\k<url> class="lozad"')
# here \k<something> where something is the name of the group in your regex.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment