class Regexp::Expression::EscapeSequence::CodepointList

Public Instance Methods

char() click to toggle source
# File lib/regexp_parser/expression/classes/escape_sequence.rb, line 41
def char
  raise NoMethodError, 'CodepointList responds only to #chars'
end
chars() click to toggle source
# File lib/regexp_parser/expression/classes/escape_sequence.rb, line 49
def chars
  codepoints.map { |cp| cp.chr('utf-8') }
end
codepoint() click to toggle source
# File lib/regexp_parser/expression/classes/escape_sequence.rb, line 45
def codepoint
  raise NoMethodError, 'CodepointList responds only to #codepoints'
end
codepoints() click to toggle source
# File lib/regexp_parser/expression/classes/escape_sequence.rb, line 53
def codepoints
  text.scan(/\h+/).map(&:hex)
end
match_length() click to toggle source
# File lib/regexp_parser/expression/methods/match_length.rb, line 160
def match_length
  MatchLength.new(self, base: codepoints.count)
end