$ Windows newline symbol in Python bytes regex
问题 $ matches at the end of a line, which is defined as either the end of the string, or any location followed by a newline character. However, the Windows newline flag contains two characters '\r\n' , how to make '$' recognize '\r\n' as a newline character in bytes ? Here is what I have: # Python 3.4.2 import re input = b''' //today is a good day \r\n //this is Windows newline style \r\n //unix line style \n ...other binary data... ''' L = re.findall(rb'//.*?$', input, flags = re.DOTALL | re