Re: New ARI warning Wed Oct 2 01:56:22 UTC 2019

Tom Tromey
2019-10-02T17:35:35Z

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

>> +/%p[^][sF]/ && !/%prec/ {

Simon> My mind is a bit confused by that regex: aren't the [^] and [sF] considered
Simon> as two successive character sets? If so, the caret character, which negates
Simon> the character set, applies to nothing.

I believe that in most regexp syntax, a "]" doesn't need to be quoted in
a character class, provided it is either the first character (like
"[]...]") or comes immediately after the "^" (like "[^]...]").

The gawk manual mentions this, though it does also recommend using
backslash, so maybe I should just do that.

(info "(gawk) Bracket Expressions")

To include one of the characters '\', ']', '-', or '^' in a bracket
expression, put a '\' in front of it. For example:

[d\]]

matches either 'd' or ']'. Additionally, if you place ']' right after
the opening '[', the closing bracket is treated as one of the characters
to be matched.

Tom