mohamedmansour / stream-filter-extension

Filter your stream by removing topics from words and monitor them
http://mohamedmansour.com
9 stars 5 forks source link

Regex filter not working #21

Closed ghost closed 13 years ago

ghost commented 13 years ago

Either that or I am not using it correctly.

The keyword 'ipad?' will effectively remove all posts with 'ipad?' in them, but the keyword '/ipad[ ][?][s]/' will not. Am I using it wrong?

mohamedmansour commented 13 years ago

What are you trying to match? That regular expression is not valid, are you trying to match ipad, ipad?, ipads? If so you should be using regex word boundaries. Something like this. Which will use word boundaries and match ipads.

/\\bipad[s]?\\b/
ghost commented 13 years ago

Ok, I'll use that, thanks!

I was trying to match ipad, ipad , ipads, ipad?

mohamedmansour commented 13 years ago

Yea, \b is a word boundary, it matches boundaries that are non word (\W) characters. Since we added a "[s]?" which is an optional s, we are matching ipads with that.