import reimport sys for line in sys.stdin: if not re.match(r'(?:\S|(?<!\s) (?!\s))*$', line): print(repr(line)) # failed
1 1 2 3 single space triple space four spaces trailing. space 1 1 1. 2.
'single space\n' 'triple space\n' 'four spaces\n' 'trailing. space \n' '1 \n' ' 1. 2. \n'
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!