class Crowbar::Selectors::CharacterClass

Overview

Selects contiguous byte sequences matching specified character classes: :digits, :hex, :alpha, :alphanumeric, :printable, :whitespace, :high_bytes.

Defined in:

crowbar/selectors/character_class.cr

Constructors

Instance Method Summary

Instance methods inherited from class Crowbar::Selector

&(other : Selector) : Selector &, |(other : Selector) : Selector |, ~ : Selector ~, select(buffer : Buffer) : Array(Tuple(Int32, Int32)) select, weight : Float64 weight, weight=(weight : Float64) weight=

Constructor methods inherited from class Crowbar::Selector

new(weight : Float64 = 1.0) new

Constructor Detail

def self.new(kind : Kind | Symbol, min_length : Int32 = 1, weight : Float64 = 1.0) #

Instance Method Detail

def kind : Kind #

def min_length : Int32 #

def select(buffer : Buffer) : Array(Tuple(Int32, Int32)) #
Description copied from class Crowbar::Selector

Returns an array of target ranges {start_index, end_index_exclusive}