Randall Munroe's (from xkcd) newest idea(kolodny.github.io)
kolodny.github.io
Randall Munroe's (from xkcd) newest idea
http://kolodny.github.io/secrets/blog/2013/11/10/make-news-more-fun/
2 comments
Time to find a text version of cspan
http://kolodny.github.io/secrets/blog/2013/11/10/make-news-more-fun/
In addition your code uses \s\s* when you just mean \s+; also you are using case-insensitive matches for the 'dictRegex' pattern with case-sensitive matches for the individual patterns, so you replace eg 'election' (lower case e) with 'undefined'.
Like the other js implementation you're not matching word boundaries (\b).