I am studying Eloquent JavaScript chapter 9 and one of the problem is to find a word without e.
The answer contains a [^\We]
, but I don't see why the \W
is important there. Sure together the square bracket means anything in the set of word character and not letter e, but why can't I just omit the \W
? I tried and it didn't work.
I had
/.*\b[^e]+\b.*/
which simply return everything. The correct answer is
/\b[^\We]+\b/i
.