|
Posted by Rik Wasmus on 01/26/08 03:59
On Sat, 26 Jan 2008 04:30:19 +0100, Summercool <Summercoolness@gmail.com=
> =
wrote:
> somebody who is a regular expression guru... how do you negate a word
> and grep for all words that is
>
> tire
>
> but not
>
> snow tire
>
> or
>
> snowtire
>
> so for example, it will grep for
>
> winter tire
> tire
> retire
> tired
>
> but will not grep for
>
> snow tire
> snow tire
> some snowtires
>
> need to do it in one regular expression
Untested:
!pregmatch('/(?<=3Dsnow[^\w]*)tire/',$string)
-- =
Rik Wasmus
Navigation:
[Reply to this message]
|