Page 1 of 1

stop words

Posted: Sun Dec 02, 2007 2:55 pm
by nguma
I have the following expression to find any instance of the word painting that is followed by another word:

/((painting) \w+)/

I am trying to run the same expression with a list of stop words, so that it would not match "painting" if the following word is "of" or "by"

Any idea on how to do such a thing?

Posted: Sun Dec 02, 2007 3:09 pm
by feyd

Code: Select all

@(?:keep|words)\W+(?!stop|words)@is
potentially.

Posted: Sun Dec 02, 2007 3:41 pm
by nguma
thanks,

isn't it

@(?:keep|words)(?!stop|words)\W+@is

though?

Posted: Tue Dec 04, 2007 2:05 am
by GeertDD
nguma wrote:thanks,

isn't it

@(?:keep|words)(?!stop|words)\W+@is

though?
No, you won't allow spaces between "keep" and "stop" then.