Class: RegExpr::Not

Inherits:
Segment show all
Defined in:
lib/regexpr.rb

Overview

/(?!VALUE)/

Instance Attribute Summary

Attributes inherited from Segment

#value

Instance Method Summary collapse

Methods inherited from Segment

deepest, #empty?, #initialize, #names, nooptimize, novalue, #optimize, optimize

Constructor Details

This class inherits a constructor from RegExpr::Segment

Instance Method Details

#to_rObject



131
132
133
134
135
136
137
# File 'lib/regexpr.rb', line 131

def to_r
	if @value.instance_of? RegExpr::Chars
		@value.not!
		@value.to_s
	else '(?!%s)'% @value
	end
end