fork(4) download
  1. class Ideone {
  2. static void main(String[] args) {
  3. def text = "output:server-01-logs_20190401162454, output:database-01-logs_20190401162454"
  4. def result = (text =~ /output:[^_]+/).collect()
  5. print(result)
  6. }
  7. }
  8.  
Success #stdin #stdout 0.86s 2252800KB
stdin
Standard input is empty
stdout
[output:server-01-logs, output:database-01-logs]