I am trying to match source when time is between 12 PM - 4 PM.
st = "error 1/23/2020 11:53:41 PM Microsoft-Windows-DistributedCOM 10010 None The server {4AA0A5C4-1B9B-4F2E-99D7-99C6AEC83474} did not register with DCOM within the required timeout."
".+/2020 (?<=12:\d\d:\d\d PM)|(?<=[1-3]:\d\d:\d\d PM) (.+?) \d+"
Why is the above regex capturing Microsoft-Windows-DistributedCOM given that time is 11:53:41 PM. Isn't it suppose to ignore it ?
"1:53:41"
is a part of"11:53:41"
, and you don't check that there's a space before it.