Re: feature request: \s in [] in regexp

2006-06-18 Thread A.J.Mechelynck

Yakov Lerner wrote:

On 6/18/06, Mikolaj Machowski <[EMAIL PROTECTED]> wrote:

Dnia niedziela, 18 czerwca 2006 12:00, Yakov Lerner napisał:
> vim unserstands \t and \n in [] in regexp (as tab and as newline).
>
> But \s is not treated as blanks in []. Can you please add
> treatment of \s as blanks in [] in regexp. I mean, \s is sort of
> space and Tab, no more complex than that, no ?

\t and \n are single characters. Vim doesn't understand classes in [].

That's why I'm asking to add it :-)

Yakov





Actually, Vim does understand classes in [] provided that they are 
expressed using the [:class:] symbolism. Thus, to specify space, tab, or 
punctuation you could use [[:blank:][:punct:]]. See about 30 lines below 
":help /[]", and the example below the list of classes.


Currently \s inside [] matches backslash or s as is explicitly noted 
under ":help /\]". I am wary of changing the meaning of existing 
constructs (even deprecated ones like this one), it could break existing 
scripts.



Best regards,
Tony.


Re: feature request: \s in [] in regexp

2006-06-18 Thread Yakov Lerner

On 6/18/06, Mikolaj Machowski <[EMAIL PROTECTED]> wrote:

Dnia niedziela, 18 czerwca 2006 12:00, Yakov Lerner napisał:
> vim unserstands \t and \n in [] in regexp (as tab and as newline).
>
> But \s is not treated as blanks in []. Can you please add
> treatment of \s as blanks in [] in regexp. I mean, \s is sort of
> space and Tab, no more complex than that, no ?

\t and \n are single characters. Vim doesn't understand classes in [].

That's why I'm asking to add it :-)

Yakov


Re: feature request: \s in [] in regexp

2006-06-18 Thread Mikolaj Machowski
Dnia niedziela, 18 czerwca 2006 12:00, Yakov Lerner napisał:
> vim unserstands \t and \n in [] in regexp (as tab and as newline).
>
> But \s is not treated as blanks in []. Can you please add
> treatment of \s as blanks in [] in regexp. I mean, \s is sort of
> space and Tab, no more complex than that, no ?

\t and \n are single characters. Vim doesn't understand classes in [].
But you can use [[:space:]] (but [:space:] is only  and ).

m.