Regex Multline Python
Question: i am currently trying to do a regex on pyhthon that should match multline.

    
    
    ([0-9]{2}\.[0-9]{2}\.[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}).*?\r\n-{1,}\sFG\s{3,}?4
    

is my regular expression, this is my python call

    
    
    re.findall("([0-9]{2}\.[0-9]{2}\.[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}).*?\r\n-{1,}\sFG\s{3,}?4.*?", content, flags=re.M)
    

However when i use the Regex for example in Notepad++ it provides me with the
proper matches whereas in python it does not match anything at all (here is an
example string that is matched in npp but not in python)

19.04.2016 01:59:18 ASDF

\---- FG 3

    
    
     --------------- ASDF
    

19.04.2016 01:59:21 ASDF

\---- FG 4

    
    
     --------------- ASDF
    

19.04.2016 01:59:22 ASDF

\---- FG 4

    
    
     --------------- ASDF
    

I am also sure that there in fact is a \r\n since npp provides me with
matches.

Since i am using the multiline flag i have absoultley no idea why my regex
wont work.


Answer: Note that in the corrected input shown, the part `FG\s{3,}?4`of the pattern
avoids a match as a single space does not match between `FG`and the `4`.

    
    
    #! /usr/bin/env python
    from __future__ import print_function
    import re    
    
    content = "19.04.2016 05:31:03 ASDFASDF\r\n---- FG 4 "
    pattern = (r'([0-9]{2}\.[0-9]{2}\.[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}).*?'
               r'\r\n-{1,}\sFG\s{1,}?4.*?')
    print(re.findall(pattern, content, flags=re.M))
    

gives me (unmodified with python 2.7.11 and 3.5.1):

    
    
    ['19.04.2016 05:31:03']
    

**Edit** : Here a version for the updated amended input samples as transcribed
by @poke:

    
    
    #! /usr/bin/env python
    from __future__ import print_function
    import re
    
    content = ("19.04.2016 05:31:03  ASDFASDF\r\n---- FG   4"
               "\r\n19.04.2016 05:31:03  ASDFASDF\r\n---- FG   4"
               "\r\n19.04.2016 05:31:03  ASDFASDF\r\n---- FG   4"
               "\r\n19.04.2016 05:31:03  ASDFASDF\r\n---- FG   4"
               "\r\n19.04.2016 05:31:03  ASDFASDF\r\n---- FG   4")
    pattern = (r'([0-9]{2}\.[0-9]{2}\.[0-9]{4}\s[0-9]{2}:[0-9]{2}:[0-9]{2}).*?'
               r'\r\n-{1,}\sFG\s{1,}?4.*?')
    print(re.findall(pattern, content, flags=re.M))
    

Gives (as to be expected):

    
    
    ['19.04.2016 05:31:03', '19.04.2016 05:31:03', '19.04.2016 05:31:03', '19.04.2016 05:31:03', '19.04.2016 05:31:03']
    

