Posted By

hansamann on 02/02/07


Tagged

regex regular expressions groovyseries


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

jsbournival
hendersk
mbanfi
adaptives


Groovy Series: Regular Expressions 2/3


 / Published in: Groovy
 

URL: http://hansamann.podspot.de/files/grails_podcast_episode_32_1036.mp3

  1. //examples for match operator - match is more restrictive than find!
  2. def line = "This is a test line"
  3. assert line ==~ /This is a test line/
  4. line -= " line"
  5. assert !(line ==~ /This is a test line/)
  6. def booleanValue = (line ==~ /This is a test/)
  7. assert booleanValue == true

Report this snippet  

You need to login to post a comment.