Sun 05 Jun 2016 06:49:50 PM UTC, original submission:
I'm trying to catch references of the wrong type. For example, I label all of my propositions by \label{prop:some proposition}. (Note the "prop" prefix.) If I refer to that after the word "Proposition", then that's fine. But it should be an error to do something like Corollary~\ref{prop:some proposition}.
I'm trying to match this with a simple UserWarnRegex, but it's acting weird. If I have this in my chktexrc,
UserWarnRegex
{
[Cc]orollary.\\ref..
}
Then it successfully matches all references in my document. But if I change that last dot to a 'c', then it misses every match! Even though the dot matches a bunch of 'c' characters occurring in e.g. Corollary~\ref{cor:my corollary}.
So, this doesn't match anything:
UserWarnRegex
{
[Cc]orollary.\\ref.c
}
even though it should match such a Corollary reference. (That other dot should be a curly brace, but those make it act weird too...)
Ultimately, the expression that I would like to work is,
UserWarnRegex
{
[Cc]orollary.\\ref{[^c]
}
because that will catch "prop", "thm", "definition", etc.
|