I'm having trouble to find the matches with the above code:
sample="""[2019-01-02 16:15:17.882][P:1624/T:1420][UIPCall.cpp:743
CUIPCall::HandleUICEvent()][Enter]
[2019-01-02 16:15:17.883][P:1624/T:1420][UIPCallState.cpp:1776
CUIPCallIncomingLine1State::HandleUICEvent()][Enter]"""
pattern=r'\[(.*?)\]\[(.*?)\]\[(.+?)(HandleUICEvent|FastNtfClosed_Line1_Common|Login|Logout)\(\)\]\[(.*?)\]$'
p= re.compile(pattern, re.MULTILINE | re.DOTALL)
p.match(sample)
it is troubling me because it works on https://regex101.com/r/hw7pyY/1 but does not match anything on python.
It has to be re.match()
as I need the .end()
and .start()
functions.