class RegexpExamples::CharGroup

The most generic type of group, which contains 0 or more characters. Technically, this is the ONLY type of group that is truly necessary However, having others both improves performance through various optimisations, and clarifies the code’s intention. The most common example of CharGroups is: /[abc]/

Public Class Methods

new(chars, ignorecase) click to toggle source
# File lib/regexp-examples/groups.rb, line 86
def initialize(chars, ignorecase)
  @chars = chars
  @ignorecase = ignorecase
end

Public Instance Methods

result() click to toggle source
# File lib/regexp-examples/groups.rb, line 91
def result
  @chars.lazy.map do |result|
    GroupResult.new(result)
  end
end