...
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.
...