RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

The difference between back-references and global variables in Ruby regexp

Use back-references for processing strings within the gsub method call. Choose global variables when using a block instead of a replacement argument, or if the regexp call is before manipulating with the result.

https://shellycloud.com/blog/2015/03/the-difference-between-backreferences-and-global-variables-in-ruby-regex

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in