Posted By

hansamann on 02/02/07


regex regular expressions groovyseries

Versions (?)

Who likes this?

6 people have marked this snippet as a favorite


Groovy Series: Regular Expressions 1/3

 / Published in: Groovy


This snippet gives you some interesting examples what you can do with Strings and GStrings in Groovy. Listen to the audio to get the best learning experience. Simply right-click on the title above -> Save as... to download the mp3 file of this part of the series.

The Groovy Series is part of the Grails Podcast and can be subscribed to via: The series is produced by Dierk K├Ânig and Sven Haiges, further information about the topic of this episode can be found in the book

Groovy in Action -

Report this snippet  


RSS Icon Subscribe to comments
Posted By: adaptives on February 5, 2009

Hmmm interesting.

I changed line 41 to have one more group in the regex, and the code failed at runtime. Then when I added another parameter to the closure, it worked. The number of parameters expected in the closure are num_groups + 1. We need one more for the 'all' (which I guess must be holding all the groups of that match).

Thanks for the tutorial.

You need to login to post a comment.