in reply to Re: Re: stupid question about regexp - not matching a word
in thread stupid question about regexp - not matching a word

Do you not want to use lookbehind because of efficiency concerns, or some other reason? It seems to be just the right tool for the job... It's doing what you were trying to do in your original code: making sure "abc" does not match before "nevermind".

As far as using [^abc] to do the job, [] represents a character class within regular expressions, and can only match a single character at a time. So unfortunately, you can't use [] to match anything more than a single character.

-- Mike

--
just,my${.02}

Replies are listed 'Best First'.
Re: Re: Re: Re: stupid question about regexp - not matching a word
by december (Pilgrim) on Jul 16, 2002 at 00:41 UTC

    It's not really because of efficiency concerns, I would like my regexp (if possible) to work with the sadly enough more simple c regexp function in sed and grep. I'm not sure that look-behinds are supported.

    I'm just learning more about regexp's, which is why I wanted to solve it without multiple lines of perl code. I'm a bit surprised that you can group several words in an or-chain, but not negate the matching of a single word without look-behind.

    Not really a problem though, I'll just use look-behinds. Thanks again for your time...

       wouter