title: Negative lookahead assertion in python
body: <p>I am having below two line of log, where I want to have separate regular expression for finding each of them. There is no problem to trigger on the second log line. But I have problem to design expression for the first line. The name <code>Reset Reason test</code> is just an example of test, number of words in it may vary therefore I cannot define here any, more specific pattern, then  just <code>.*</code>.</p>
  
  <pre><code>12.07.2016 13:54:20 SCR_OUTPUT: #### TC_0006 Reset Reason test
  12.07.2016 13:54:20 SCR_OUTPUT: #### TC_0006 Reset Reason test done.
  </code></pre>
  
  <p>I am having regular expression generally doing the thing I want it to do:</p>
  
  <pre><code>([0-9:. ]*) SCR_OUTPUT: #### (TC_[a-fA-F0-9]{4,5}[:0-9]{0,4}) .*[ ](?!done\.$)
  </code></pre>
  
  <p>And I have two cases that I want to differentiate:
  I based on example given here.
  <a href="https://docs.python.org/3/howto/regex.html#lookahead-assertions" rel="nofollow">https://docs.python.org/3/howto/regex.html#lookahead-assertions</a></p>
  
  <p>Everything work fine when it ends like this: (of course I have to modify my test strings)</p>
  
  <pre><code>[.](?!done$)
  </code></pre>
  
  <p>When I try it to be something that suits me more eg: ( my <code>done.</code> has dot at the end)</p>
  
  <pre><code>[.](?!done\.$)
  </code></pre>
  
  <p>Then it gets weird.
  Another adaptation. <code>done.</code> should be followed with space and not with dot and the result gets crazy. Each line is giving positive findings.</p>
  
  <pre><code>[.](?!done\.$)
  </code></pre>
  
  <p>I have been testing that on <a href="http://pythex.org/?regex=(%5B0-9%3A.%20%5D%7B19%7D)%20.*SCR_OUTPUT%3A%20%23%23%23%23%20(TC_%5Ba-fA-F0-9%5D%7B4%2C5%7D%5B%3A0-9%5D%7B0%2C4%7D)%20(.*)%5B%20%5D(%3F!done%5C.%24)&amp;test_string=12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20sendmail.cf%0A12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20%20autoexec%0A12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20autoexec%20bat%0A12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20foo.bar%0A12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20first.run%0A12.07.2016%2013%3A26%3A11%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20%20run.exe%0A12.07.2016%2013%3A54%3A20%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20done%0A12.07.2016%2013%3A54%3A20%20SCR_OUTPUT%3A%20%23%23%23%23%20TC_0006%20Reset%20Reason%20test%20done.&amp;ignorecase=0&amp;multiline=1&amp;dotall=0&amp;verbose=0" rel="nofollow">pythex.org</a>.
  Under this link you can find latest version my experiment.</p>
  
  <p>Anyone knows where I am having a bug?
  Is it anyhow possible to trigger on such case?
  Maybe I should do it in two steps?</p>