src code

instance method String#scan

String#scan(pattern, iterator) → String

Allows iterating over every occurrence of the given pattern (which can be a string or a regular expression). Returns the original string.