I proofread a lot of plaintext files submitted by peers. As my eyes get tired I sometimes overlook extra spaces, or duplicate words. I currently use the following RegEx searches:
[/t]{2} -Finds duplicate spaces
(?>(/p{P})\1+)(?<![^.]|^)\.{3}) -Finds duplicate punctuation except ellipses
\b(\w+)\s+\1\b -Finds duplicate words
I also have a few custom searches, example find "Mister" and replace with "Mr."
Is there a simple way to execute these four types of replace functions in JavaScript?