(Mar-14-2020, 01:20 PM)Skaperen Wrote: i didn't have anything to try. and these sample regexes don't look like they are anywhere close to checking the whole line for validityNeed to have input to test on,or make some input as i done then can also try to make as difficult as possible to see how the regex work for many cases.
(Mar-14-2020, 01:20 PM)Skaperen Wrote: perhaps works OK on valid lines, but can it report all possible invalid lines as invalid?The would be all lines that the regex don't match.
>>> def_line ['def my_game():', 'def foo(arg):', 'def Bar(args*, kwargs**):'] >>> >>> for line in text.split('\n'): ... if line not in def_line: ... print(line) ... print('Game running') def 123 pass pass hello def is nice def () wrong