Skip to content

Instantly share code, notes, and snippets.

View bruceblore's full-sized avatar

Bruce Blore bruceblore

View GitHub Profile
@bruceblore
bruceblore / regex.md
Created March 14, 2018 20:33
editing-regex

Editing-Regex

This file contains some regex patterns that are useful for editing formal writing, such as essays. Note that this is not perfect and you only use this ALONGSIDE proper editing.

Contractions

Contractions are frowned upon, so detect them with [a-zA-Z]+'[a-zA-Z]{1,2}. This also detects posessives.

Past Tense

If your writing is supposed to be in present tense, it is apparently pretty easy to accidently write in past tense. Detect all words ending with "ed" using [a-zA-Z]+ed[^a-zA-Z]. Note that this also detects words that already end in ed without being past tense and may not even be verbs. For example, red and need.

I will add more if i think of any that would be useful.