0
Diese gesucht ok:Python regexp n Ausgabe
>>> re.search(r'(.*?)\r\n(.+?)\r\n', 'aaa\r\r\nbbb\r\n').groups()
('aaa\r', 'bbb')
Aber wenn ich einen von drei b
ersetzen \n
es nicht nach:
>>> re.search(r'(.*?)\r\n(.+?)\r\n', 'aaa\r\r\nb\nc\r\n').groups()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'groups'
Aber ich will in der zweiten Fall analysieren:
('aaa\r', 'b\nc')
Dank! Ja '.' nicht übereinstimmend' \ n' standardmäßig – user3479125