Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: ==~ operator was split over newline.

...

If you put that in the groovyConsole and run it, it will evaluate to true. There are a couple of things to notice. First is the ==
~ operator, which is similar to the == operator, but matches patterns instead of computing exact equality. Second is that the regular expression is enclosed in /'s. This tells groovy (and also anyone else reading your code) that this is a regular expression and not just a string.

...