fork download
  1. class Ideone {
  2. static void main(String[] args) {
  3. String commitMsg = "#build #images = image-a, image-b,image_c, imaged , image-e #setup=my-setup fixing issue with px"
  4. def re = /(?i)(?:\G(?!^)\s?,\s?|#images\s?=\s?)(\w+(?:-\w+)*)/
  5. def res = (commitMsg =~ re).collect { it[1] }
  6. print(res)
  7. }
  8. }
  9.  
Success #stdin #stdout 2.09s 141740KB
stdin
Standard input is empty
stdout
[image-a, image-b, image_c, imaged, image-e]