def strings_in(data,options={},&block)
      unless block
        if options[:offsets]
          found = {}
          block = lambda { |offset,substring| found[offset] = substring }
        else
          found = []
          block = lambda { |substring| found << substring }
        end

        strings_in(data,options,&block)
        return found
      end

      min_length = options.fetch(:length,4)
      return if data.length < min_length

      index = 0

      while index <= (data.length - min_length)
        if self === data[index,min_length]
          sub_index = (index + min_length)

          while self.include_char?(data[sub_index,1])
            sub_index += 1
          end

          match = data[index...sub_index]

          case block.arity
          when 2
            yield match, index
          else
            yield match
          end

          index = sub_index
        else
          index += 1
        end
      end
    end
def strings_in(data,options={},&block)
      unless block
        if options[:offsets]
          found = {}
          block = lambda { |offset,substring| found[offset] = substring }
        else
          found = []
          block = lambda { |substring| found << substring }
        end

        strings_in(data,options,&block)
        return found
      end

      min_length = options.fetch(:length,4)
      return if data.length < min_length

      index = 0

      while index <= (data.length - min_length)
        if self === data[index,min_length]
          sub_index = (index + min_length)

          while self.include_char?(data[sub_index,1])
            sub_index += 1
          end

          match = data[index...sub_index]

          case block.arity
          when 2
            yield match, index
          else
            yield match
          end

          index = sub_index
        else
          index += 1
        end
      end
    end
Finds sub-strings within given data that are made of characters within
 the character set.

 @param [String] data
   The data to find sub-strings within.

 @param [Hash] options
   Additional options.

 @option options [Integer] :length (4)
   The minimum length of sub-strings found within the given data.

 @option options [Boolean] :offsets (false)
   Specifies whether to return a Hash of offsets and matched
   sub-strings within the data, or to just return the matched
   sub-strings themselves.

 @yield [match,(index)]
   The given block will be passed every matched sub-string, and the
   optional index.

 @yield [String] match
   A sub-string containing the characters from the character set.

 @yield [Integer] index
   The index the sub-string was found at.

 @return [Array, Hash]
   If no block is given, an Array or Hash of sub-strings is returned.