Reputation: 24353
Can anyone explain the following?
println('x' ==~ /x/)
println('x' !=~ /x/)
result:
true
true
Upvotes: 2
Views: 712
Reputation: 13924
There is no !=~
operator in groovy. It's a combination of !=
and ~
.
println('x' !=~ /x/)
is equivalent to
println('x' != (~ /x/))
What you need is
println(!('x' ==~ /x/))
Upvotes: 4