Given that this work in a Python 3 repl:

import re
txt = "Some random text"
if re.search(r"\b\w{4}\b", txt): txt
'Some random text'

.... and this works on the command line, printing all lines in logs.txt:

$ python3 -m oneliner -ne 'line' logs.txt

..... why does this fail:

$ python3 -m oneliner -m re -ne 'if re.search(r"\b\w{4}\b", line): line' logs.txt
syntax error in: if re.search(r"\b\w{4}\b", line): line


gvim
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to