Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

regular expressions

  • Loading branch information...
commit 7e92100b6de7a87e1369ee773195661509a77001 1 parent f437a3d
Manuel Alonso authored

Showing 1 changed file with 8 additions and 1 deletion. Show diff stats Hide diff stats

  1. +8 1 strings/regExp.groovy
9 strings/regExp.groovy
... ... @@ -1,3 +1,4 @@
  1 +
1 2 reg = ~"hello"
2 3
3 4 println reg.getClass().name
@@ -14,4 +15,10 @@ if(text ==~ pattern)
14 15 println 'matches'
15 16 else
16 17 println 'no matches'
17   -
  18 +
  19 +matcher = 'Groovy is groovy' =~ /(G|g)roovy/
  20 +print "Size of matcher is ${matcher.size()} with elements :"
  21 +println ""
  22 +matcher.each {
  23 + println "${it}"
  24 +}

0 comments on commit 7e92100

Please sign in to comment.
Something went wrong with that request. Please try again.