Loading [Contrib]/a11y/accessibility-menu.js
Back
Close

Groovy Regex

smartdiscover17
1,802 views

Groovy Regex!

This template is created to help you learn different usage of regex in Groovy

//lets see how to use regex in groovy
//==~ is the pattern matcher
//results in java.util.regex.Matcher instance
def finder = ('groovy' =~ /gr.*/)
println finder instanceof java.util.regex.Matcher
def matcher = ('groovy' ==~ /gr.*/)
println matcher instanceof Boolean
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants