(?=((?!exp).)*a.*)
is also wrong; it doesn't match "expba", but (?~exp)a.*
does. (?=((?!exp).)*a.*)
is also wrong; it doesn't match "expba", but (?~exp)a.*
does. /(?=((?!exp).)*a.*)/ =~ "expba"
# => 1
for me at least (using #match is also truthy, but the matched string is not what I'd guess the absent operator would give).