/ Published in: Groovy
- //pattern examples. Creating a time pattern that can be reused.
- def timePattern = ~/\d\d:\d\d/
- def timeString = "Between 06:00 and 10:00, most geeks are asleep."
- def matcher = timePattern.matcher(timeString)
- def anotherTimeString = "But between 22:00 and 02:00, most geeks are awake"
- //we reuse the pattern
- matcher = timePattern.matcher(anotherTimeString)
- times = 
You need to login to post a comment.