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.
Post a comment