Angus Lees <[EMAIL PROTECTED]> wrote:
> On Tue, Jul 11, 2000 at 11:20:15AM +1000, Rick Welykochy wrote:
>> Note that vi like perl is a smarty pants.
>> A $ is only interpreted as a line end if
>> it is the last char in the pattern.
> err.. thats the way its supposed to be (for basic regex's)
Indeed, reading the specs again, it seems that if you put a backslash before
a $ when it is not an anchor (i.e., the end of a regular expression, or the
end of a subexpression), the behaviour is undefined! Fortunately, most
implementations treat it as a literal $.
> hey, i just learnt about collating elements:
> [^[.abc.]] is the same as [^a][^b][^c] (ie: `not "abc"')
Damn, have to pick on you again :) [.abc.] only makes sense if abc is a
collating element in your locale. And if that is the case, [^[.abc.]] will
match any collating element or character in your locale not equal to abc.
So if your locale's collating elements were just the POSIX locale plus the
collating element abc, [^[.abc.]] will match a single character, except a,
b, or c when they are part of the collating element abc, i.e., it'll match
the a in "add", but not the a in "abc", it'll match the b in "kbc", but not
the b in "abc".
Finally, in such a locale, [^[.abc]] will only match a single character, while
[^a][^b][^c] may match anywhere between 3 to 9 characters.
--
Debian GNU/Linux 2.1 is out! ( http://www.debian.org/ )
Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug