Module: Gemmy::Patches::StringPatch::InstanceMethods::EachMatch
- Defined in:
- lib/gemmy/patches/string_patch.rb
Instance Method Summary collapse
-
#each_match(re) ⇒ Object
facets iterator over matches from regex.
Instance Method Details
#each_match(re) ⇒ Object
facets iterator over matches from regex
137 138 139 140 141 142 143 144 145 |
# File 'lib/gemmy/patches/string_patch.rb', line 137 def each_match(re) #:yield: if block_given? scan(re) { yield($~) } else m = [] scan(re) { m << $~ } m end end |