Oct-27-2017, 03:43 PM
(Oct-27-2017, 03:35 PM)heiner55 Wrote:print("Line ", linenr, ": ", match[1], sep='')
I typed the following and received the "SyntaxError: invalid syntax", with the '=' sign highlighted in red in the line print("Line", liner, ":", match[1], sep='')
"
>>> pattern = re.compile(r"tel:\s*?\+44\s*?(\d{10,10})")
>>> with open ('phone_log.txt') as in_file:
for linenr, line in enumerate(in_file):
match = re.search(pattern, line, re.X)
if match:
print("Line", liner, ":", match[1], sep='')
SyntaxError: invalid syntax
>>> "