Skip to content

Instantly share code, notes, and snippets.

@bruceblore
Created March 14, 2018 20:33
Show Gist options
  • Save bruceblore/481d63bf3b05fef3d667045c172f1b9a to your computer and use it in GitHub Desktop.
Save bruceblore/481d63bf3b05fef3d667045c172f1b9a to your computer and use it in GitHub Desktop.
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment