Skip to content

Instantly share code, notes, and snippets.

@quinncomendant
Last active February 16, 2018 10:34
Show Gist options
  • Save quinncomendant/805a1f8182036151a1292d98eefe75a0 to your computer and use it in GitHub Desktop.
Save quinncomendant/805a1f8182036151a1292d98eefe75a0 to your computer and use it in GitHub Desktop.

A list of contractions from divinewrite and a regex to find and eradicate the more unseemly from your documents (remember to use a case-insensitive search).

Regex to catch both the “least formal” and “less formal” contractions:

\b((could|how|might|must|should|that|what|when|where|why|would|it)n?['‘’](d|ll|re|ve)|why['‘’]s|we['‘’](d|re|ve|ll)|s?he['‘’](s|d|ll)|(where|how|when|who)['‘’](s)|(who|you|it)['‘’](d)|(they|who)['‘’](ll|ve)|(might|must)n['‘’]t|i'd)\b

Least formal

Regex to catch these:

\b((could|how|might|must|should|that|what|when|where|why|would|it)n?['‘’](d|ll|re|ve)|why['‘’]s)\b
  • how’ll
  • what’re
  • why’ll
  • should’ve
  • would’ve
  • must’ve
  • could’ve
  • when’ll
  • might’ve
  • where’ll
  • why’d
  • where’d
  • why’s
  • it’ll
  • what’ll
  • that’d
  • that’ll
  • what’d

Less formal

Regex to catch these:

\b(we['‘’](d|re|ve|ll)|s?he['‘’](s|d|ll)|(where|how|when|who)['‘’](s)|(who|you|it)['‘’](d)|(they|who)['‘’](ll|ve)|(might|must)n['‘’]t|i'd)\b
  • I’d
  • we’re
  • we’d
  • she’ll
  • we’ve
  • he’ll
  • we’ll
  • she’s
  • he’s
  • mightn’t
  • where’s
  • how’s
  • she’d
  • when’s
  • he’d
  • who’s
  • it’d
  • who’d
  • you’d
  • mustn’t
  • they’ll
  • who’ll
  • they’ve

Most formal

These are acceptable in even the more formal business documents (no need for a regex here).

  • I’ll
  • I’ve
  • I’m
  • you’ll
  • you’re
  • you’ve
  • what’s
  • weren’t
  • they’re
  • won’t
  • don’t
  • doesn’t
  • isn’t
  • aren’t
  • wasn’t
  • hasn’t
  • haven’t
  • hadn’t
  • didn’t
  • shouldn’t
  • couldn’t
  • can’t
  • it’s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment