Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

regular expressions

  • Loading branch information...
commit 7e92100b6de7a87e1369ee773195661509a77001 1 parent f437a3d
@manute authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 strings/regExp.groovy
View
9 strings/regExp.groovy
@@ -1,3 +1,4 @@
+
reg = ~"hello"
println reg.getClass().name
@@ -14,4 +15,10 @@ if(text ==~ pattern)
println 'matches'
else
println 'no matches'
-
+
+matcher = 'Groovy is groovy' =~ /(G|g)roovy/
+print "Size of matcher is ${matcher.size()} with elements :"
+println ""
+matcher.each {
+ println "${it}"
+}

0 comments on commit 7e92100

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