Created
August 22, 2016 15:01
-
-
Save abelsromero/6162be84ec329c54a57a482172736116 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def extract(String text) { | |
| (text =~ /([a-z]+)((\.[a-z]+)*?)/).collect { it[0] } | |
| } | |
| /** | |
| * println extract('groovy.grails.ruby.rails') | |
| * | |
| * $> [groovy, grails, ruby, rails] | |
| */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment