[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [^\]] in basic regexes
From: |
Andreas Schwab |
Subject: |
Re: [^\]] in basic regexes |
Date: |
Sat, 14 Feb 2009 15:27:34 +0100 |
User-agent: |
Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) |
Wacek Kusnierczyk <address@hidden> writes:
> if, as you seem to imply, the pattern is 'a non-backslash followed by a
> closing bracket', then
> - the rightmost closing bracket is *outside* of any class (the class
> [^\] has been closed), thus
Right.
> - it is (should be) a *metacharacter*, and and as such
Wrong.
> - it must be taken as *closing a class*, which is not there and it
> neither should match the closing bracket in the data (which it does in
> some of the other examples)
The ']' character is only special when part of a bracket expression. In
all other contexts it just matches itself.
Andreas.
--
Andreas Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."