Skip to content

Instantly share code, notes, and snippets.

@nolanlawson
Created January 24, 2013 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nolanlawson/4620369 to your computer and use it in GitHub Desktop.
Save nolanlawson/4620369 to your computer and use it in GitHub Desktop.
Gist for the best regex for escaping bad spellcheck suggestions in Groovy. Should be easily portable to JavaScript and Java, or just paste into groovysh.
import java.util.regex.Pattern;
// note that you won't need to escape the $ in Java
Pattern filterBadSpellcheckPattern = Pattern.compile("[:.,;!?\\)\\('\"\\-\u2026\u00AE\u00A9]\$")
@skriewel
Copy link

also: \u00B3\u00BB\u2013\u2014\u2019\u201C\u201D\u2020\u2022

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