Groovy Quiz 29 | Regular Expressions Reference video | Groovy Playground 1 Point for every correct answer | Let’s Get Started 1. A regular expression, regex or regexp is a sequence of characters that define a search pattern. Patterns used to find substrings in a text True False 2. Guess the output You can run and check the code here – https://groovy-playground.appspot.com/ def match = "Groovy" =~ "Groovy" println match[0] Groovy 1 null exception 3. Guess the output You can run and check the code here – https://groovy-playground.appspot.com/ def match = "Groovy" =~ "123" if(match){ println match[0] }else{ println "No match found" } Groovy 123 null No match found 4. Guess the output You can run and check the code here – https://groovy-playground.appspot.com/ def match = "Groovy" =~ "o" if(match){ def num=0 while(match){ print match[num] num++ } }else{ println "No match found" } No match found oo exception Loading … 6 Share this:TwitterFacebookLinkedIn Related