fork download
  1. import re
  2.  
  3. text = r"""--hello
  4. --goodbye
  5. ROW_NUMBER() OVER (ORDER BY DATE) --date
  6. --comment with some indentation
  7. --another comment with some indentation"""
  8.  
  9. print( re.findall(r'^[^\S\r\n]*(--.*)', text, re.M) )
Success #stdin #stdout 0.04s 9500KB
stdin
Standard input is empty
stdout
['--hello', '--goodbye', '--comment with some indentation', '--another comment with some indentation']