fork download
  1. object Main extends App {
  2. val text = """this is line 1
  3.  
  4. ------------------------------
  5.  
  6. this is line 2
  7.  
  8. +++++++++++++++++++++++++
  9.  
  10. this is line 3
  11.  
  12. ---------------
  13.  
  14. this is line 4"""
  15. print(text.split("\\r?\\n").filter(line=>line.matches("""(\++|-+)?""") == false).toList)
  16. }
Success #stdin #stdout 0.39s 4382720KB
stdin
Standard input is empty
stdout
List(this is line 1, this is line 2, this is line 3 , this is line 4)