class Regexp::Expression::EscapeSequence::CodepointList
Public Instance Methods
char()
click to toggle source
# File lib/regexp_parser/expression/classes/escape_sequence.rb, line 40 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 48 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 44 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 52 def codepoints text.scan(/\h+/).map(&:hex) end
match_length()
click to toggle source
# File lib/regexp_parser/expression/methods/match_length.rb, line 164 def match_length MatchLength.new(self, base: codepoints.count) end