Class: Regex::CharShorthand
- Inherits:
-
AtomicExpression
- Object
- Expression
- AtomicExpression
- Regex::CharShorthand
- Defined in:
- lib/regex/char_shorthand.rb
Overview
A pre-defined character class is in essence a name for a built-in, standard character class.
Constant Summary collapse
- StandardCClasses =
A constant Hash that defines all the predefined character shorthands. It contains pairs of the form: a pre-defined character shorthand letter => a CharRange object
{ 'd' => '[0-9]', 'D' => '[^0-9]', 'h' => '[0-9a-fA-F]', 'H' => '[^0-9a-fA-F]', 's' => '[ \t\r\n\f]', 'S' => '[^ \t\r\n\f]', 'w' => '[0-9a-zA-Z_]', 'W' => '[^0-9a-zA-Z_]' }.freeze
Instance Attribute Summary collapse
-
#shortname ⇒ Object
readonly
An one-letter abbreviation.
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(aShortname) ⇒ CharShorthand
constructor
Constructor.
Methods inherited from AtomicExpression
Methods inherited from Expression
Constructor Details
#initialize(aShortname) ⇒ CharShorthand
Constructor
26 27 28 |
# File 'lib/regex/char_shorthand.rb', line 26 def initialize(aShortname) @shortname = valid_shortname(aShortname) end |
Instance Attribute Details
#shortname ⇒ Object (readonly)
An one-letter abbreviation
23 24 25 |
# File 'lib/regex/char_shorthand.rb', line 23 def shortname @shortname end |