Yes, how often a regular expression is used depends on the method used, and not on the flags of regular expressions.
scan returns an array containing (or iterating over) all regular expression matches. match and String#[] will return the first match. =~ will return the index of the first match. gsub will replace all occurrences of the regex, and sub will replace the first occurrence.
source share