<div dir="ltr">Hi Christian,<div style>LOL and thank you a lot for your long reply and the obvious hint ;-) I must have been pretty tired to not realize this section in the script.<br></div><div style><br></div><div style>
While rusty with Perl (I once wrote some Nagios check scripts in it several years ago and before there were Icinga and Shinken), I got some test script working and added my few cases. Unfortunately, I am unable to push these back upstream (might be PEBKAC), so that I attached the patch to this mail. Could you please take care of integrating the changes?</div>
<div style><br></div><div style>Have a nice week!</div><div style>Philipp</div><div style><br></div><div style>PS: Next week - <a href="http://www.linuxtag.org/2013/">Linuxtag in Berlin</a>! Will you be there?</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/5/12 Christian Lohmaier <span dir="ltr"><<a href="mailto:lohmaier+libreoffice@googlemail.com" target="_blank">lohmaier+libreoffice@googlemail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Philipp, *,<br>
<div class="im"><br>
On Sun, May 12, 2013 at 9:40 PM, Philipp Riemer <<a href="mailto:ruderphilipp@gmail.com">ruderphilipp@gmail.com</a>> wrote:<br>
><br>
> Thanks for the link. Uh, Perl...<br>
<br>
</div>regular expressions would be mor or less the same in other langauges,<br>
so no difference here. And using something else than perl "just for<br>
the sake of it" would be pointless.<br>
<div class="im"><br>
> Nevertheless, the important line seems to<br>
> be:<br>
><br>
> ($line =~ /\b(?<!\/)[Ee]rror(?!\.)\b/)|| # C make error<br>
</div>> [...]<br>
<div class="im">> What I want, is to ignore it if there is ... at the end of the string:<br>
<br>
</div>You didn't bother to look at the whole file, so I won't bother to<br>
write a long reply right now.<br>
<div class="im"><br>
> So far I have the following (see <<a href="http://perldoc.perl.org/perlre.html" target="_blank">http://perldoc.perl.org/perlre.html</a>>):<br>
><br>
> (?!\.) matches<br>
> (1) a single arbitrary character or<br>
<br>
</div>no.<br>
<div class="im"><br>
> (2) an exclamation mark or<br>
<br>
</div>no.<br>
<br>
the ? signals a group-matching modifier. i.e. it changes the meaning<br>
of the () block. ?! makes the stuff in () to be a "A zero-width<br>
negative look-ahead assertion."<br>
<br>
> (3) a dot<br>
<br>
yes (and no) - it matches a dot inside the (), but the whole rule says<br>
it should only match the previous part *not* followed by a dot.<br>
<br>
Similarily, the (?<!\/) is a "A zero-width negative look-behind assertion"<br>
<br>
So the pattern matches Error or error, but only if that [Ee]rror is<br>
not after a / and not before a .<br>
<div class="im"><br>
> and the \b stands for "boundary" (alphanum on the left and !alphanum on the<br>
> right or the other way around), so obviously both, the tick and the slash,<br>
> are !alphanum (as is the colon, which should still match)...<br>
<br>
</div>Nah, you'r tricking yourself again. \b ist a change of \w to \W (not<br>
just alphanum, but also _ and some additional unicode characters) or<br>
the other way round, as you wrote yourself.<br>
But a line like foo/Error.something would happily match \bError\b -<br>
as the / marks a switch - but it should *not* match.<br>
<div class="im"><br>
> So maybe the easiest would be to add a "and !(A or B)" to the line to<br>
> invalidate a false positive match?<br>
<br>
</div>No, see my comment abve about you not looking at the whole file.<br>
<br>
There are a bunch of whitelist lines in there, lines that matche the<br>
overall error-marking regexes, that should be *ignore*d (hint, hint<br>
:-))) and not counted as errors.<br>
<br>
ciao<br>
<span class="HOEnZb"><font color="#888888">Christian<br>
</font></span></blockquote></div><br></div>