Sha256: f204eb0e90de03c6bf36688789638b9591442570782a9a18481e37495cc28c00
Contents?: true
Size: 439 Bytes
Versions: 2
Compression:
Stored size: 439 Bytes
Contents
class String # Given 'string', find all matches of regular expression (removed from # +string+) and return them as an array of strings. def pull_regex(regexp) found_values = [] until ((value = self[regexp]).nil?) vindex = index(value) self[ vindex .. (vindex + value.length) ] = "" found_values << value.match(regexp)[1] end return found_values end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
mastodon-0.3.1 | lib/core_ext/string/pull_regex.rb |
mastodon2-0.3.1 | lib/core_ext/string/pull_regex.rb |