Sha256: bddbf44033e51aeea87f5dd96a7c9bc6c56cee76ae9226ffd73a06b0aee909f9
Contents?: true
Size: 418 Bytes
Versions: 3
Compression:
Stored size: 418 Bytes
Contents
class Regexp # Searches the target for all occurrances of this Regex. If a block is given, yields each match found. # Returns an array of all matches found. def each_match(target) matches = [] offset = 0 while offset < target.length && !(match = match(target[offset..-1])).nil? offset += match.offset(0)[1] yield match if block_given? matches << match end matches end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sc-core-ext-1.2.1 | lib/sc-core-ext/regexp.rb |
sc-core-ext-1.2.0 | lib/sc-core-ext/regexp.rb |
sc-core-ext-1.0.0 | lib/sc-core-ext/regexp.rb |