fork(2) download
  1. object Main extends App {
  2. val text = "May 5 23:00:01 10.14.3.10 %ASA-6-302015: Built inbound UDP connection"
  3. val regex = """^.*?(?=\s\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s%)|(?<=[\w:]\s)\w+(?=\s[cr])""".r
  4. val result = regex.findAllIn(text)
  5. result.foreach { x => println(x) }
  6. }
Success #stdin #stdout 0.38s 4382720KB
stdin
Standard input is empty
stdout
May  5 23:00:01
UDP