Class: Regex::RawExpression

Inherits:
AtomicExpression show all
Defined in:
lib/regex/raw_expression.rb

Overview

A raw expression is a string that will be copied verbatim (as is) in the generated regular expression.

Instance Attribute Summary collapse

Attributes inherited from Expression

#begin_anchor, #end_anchor

Instance Method Summary collapse

Methods inherited from AtomicExpression

#atomic?, #done!, #lazy!

Methods inherited from Expression

#atomic?, #options, #to_str

Constructor Details

#initialize(rawLiteral) ⇒ RawExpression

Constructor

Parameters:

  • rawLiteral (String)

    Sub-pattern expressed as regexp



12
13
14
15
# File 'lib/regex/raw_expression.rb', line 12

def initialize(rawLiteral)
  super()
  @raw = rawLiteral
end

Instance Attribute Details

#rawString (readonly) Also known as: text_repr

Returns String representation of a regular expression (sub)pattern.

Returns:

  • (String)

    String representation of a regular expression (sub)pattern



8
9
10
# File 'lib/regex/raw_expression.rb', line 8

def raw
  @raw
end