class Regexp::Expression::EscapeSequence::CodepointList
Public Instance Methods
char()
click to toggle source
# File lib/regexp_parser/expression/classes/escape.rb, line 35 def char raise NoMethodError, 'CodepointList responds only to #chars' end
chars()
click to toggle source
# File lib/regexp_parser/expression/classes/escape.rb, line 43 def chars codepoints.map { |cp| cp.chr('utf-8') } end
codepoint()
click to toggle source
# File lib/regexp_parser/expression/classes/escape.rb, line 39 def codepoint raise NoMethodError, 'CodepointList responds only to #codepoints' end
codepoints()
click to toggle source
# File lib/regexp_parser/expression/classes/escape.rb, line 47 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