Re: negative match pattern, again

2006-06-13 Thread Charles E Campbell Jr
It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Edward Wong wrote:

Re: negative match pattern, again

2006-06-13 Thread Edward Wong
Very great explanation! Many thanks to Gerald and Chip Campbell. Now I _really_ got it. :) On 6/13/06, Charles E Campbell Jr [EMAIL PROTECTED] wrote: It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For

negative match pattern, again

2006-06-12 Thread Yakov Lerner
I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not containing /)\s*;/. How do I

Re: negative match pattern, again

2006-06-12 Thread Tim Chase
I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script: http://vim.sourceforge.net/scripts/script.php?script_id=1290

Re: negative match pattern, again

2006-06-12 Thread Benji Fisher
On Mon, Jun 12, 2006 at 02:42:18PM +, Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX,

Re: negative match pattern, again

2006-06-12 Thread Yakov Lerner
On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. Well, there are several ways to go about it. One would be to use Dr. Chip's logipat script:

Re: negative match pattern, again

2006-06-12 Thread Charles E Campbell Jr
Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \ ^.*foo\^XXX$ and then put, in place of XXX, the pattern that matches anything not

Re: negative match pattern, again

2006-06-12 Thread Yakov Lerner
On 6/12/06, Benji Fisher [EMAIL PROTECTED] wrote: On Mon, Jun 12, 2006 at 02:42:18PM +, Yakov Lerner wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex. I think I need to use \

Re: negative match pattern, again

2006-06-12 Thread Yakov Lerner
On 6/12/06, Gerald Lai [EMAIL PROTECTED] wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line.

Re: negative match pattern, again

2006-06-12 Thread Gerald Lai
On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Gerald Lai [EMAIL PROTECTED] wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo'

Re: negative match pattern, again

2006-06-12 Thread Charles E Campbell Jr
Gerald Lai wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/ anywhere in the line. How do I write such regex.

Re: negative match pattern, again

2006-06-12 Thread Gerald Lai
On Mon, 12 Jun 2006, Charles E Campbell Jr wrote: Gerald Lai wrote: On Mon, 12 Jun 2006, Gerald Lai wrote: On Mon, 12 Jun 2006, Yakov Lerner wrote: On 6/12/06, Tim Chase [EMAIL PROTECTED] wrote: I need to match lines using g// (not v//); those lines having 'foo' and NOT having /)\s*;/

Re: negative match pattern, again

2006-06-12 Thread Charles E Campbell Jr
Gerald Lai wrote: In the same context, pat1 should instead be: /^\%(.*bar\)[EMAIL PROTECTED] and both patterns match the same. And so they do! (with your pattern having .* again, which is unnecessary for :g... as you mentioned). Regards, Chip Campbell

Re: negative match pattern, again

2006-06-12 Thread Edward Wong
It follows the general form of a negative line search for embedded search: /^\%(.*[limit0.*]search[.*limit1]\)[EMAIL PROTECTED] For example, to match a line that contains foo but does not contain bar between big and tummy: /\%(.*big.*bar.*tummy\)[EMAIL PROTECTED] Learn a lot more