Class: LogStash::Config::AST::RegexpExpression
- Inherits:
-
Node
- Object
- Treetop::Runtime::SyntaxNode
- Node
- LogStash::Config::AST::RegexpExpression
- Defined in:
- lib/logstash/config/config_ast.rb
Instance Method Summary collapse
Methods inherited from Node
Instance Method Details
#compile ⇒ Object
480 481 482 483 484 485 486 487 488 489 490 |
# File 'lib/logstash/config/config_ast.rb', line 480 def compile operator = recursive_select(LogStash::Config::AST::RegExpOperator).first.text_value item, regexp = recursive_select(LogStash::Config::AST::RValue) # Compile strings to regexp's if regexp.is_a?(LogStash::Config::AST::String) regexp = "/#{regexp.text_value[1..-2]}/" else regexp = regexp.compile end return "(#{item.compile} #{operator} #{regexp})" end |