Re: vim and regex construct [^...]
On Sat, May 21, 2005 at 01:30:56AM -0300, Paulo Marcel Coelho Aragão wrote:
> I have just observed that vim handles negated character classes [^...]
> in an apparently odd fashion:
>
> [\n] matches \n as expected
> [^\n] matches \n ???
> [^^M] doesn't match \n ???
>
> OBS.: I got ^M typing Ctrl-V and <Enter>
>
> The results look contradictory. vim's manual states that [^...] should
> match \n. Therefore, both [^\n] and [^^M] should then match \n.
>
^M is not the newline character in Linux. Try \r if you want to match
the DOS/Windows end-of-line character.
--
Depend on the rabbit's foot if you will, but remember, it didn't help
the rabbit.
-- R.E. Shay
Reply to: