Skip to content

Instantly share code, notes, and snippets.

@davidjrice
Created April 30, 2014 22:16
  • Star 11 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save davidjrice/9d2af51100e41c6c4b4a to your computer and use it in GitHub Desktop.
List of punctuation characters
var PUNCTUATION = "" +
"’'" + // apostrophe
"()[]{}<>" + // brackets
":" + // colon
"," + // comma
"‒–—―" + // dashes
"…" + // ellipsis
"!" + // exclamation mark
"." + // full stop/period
"«»" + // guillemets
"-‐" + // hyphen
"?" + // question mark
"‘’“”" + // quotation marks
";" + // semicolon
"/" + // slash/stroke
"⁄" + // solidus
"␠" + // space?
"·" + // interpunct
"&" + // ampersand
"@" + // at sign
"*" + // asterisk
"\\" + // backslash
"•" + // bullet
"^" + // caret
"¤¢$€£¥₩₪" + // currency
"†‡" + // dagger
"°" + // degree
"¡" + // inverted exclamation point
"¿" + // inverted question mark
"¬" + // negation
"#" + // number sign (hashtag)
"№" + // numero sign ()
"%‰‱" + // percent and related signs
"¶" + // pilcrow
"′" + // prime
"§" + // section sign
"~" + // tilde/swung dash
"¨" + // umlaut/diaeresis
"_" + // underscore/understrike
"|¦" + // vertical/pipe/broken bar
"⁂" + // asterism
"☞" + // index/fist
"∴" + // therefore sign
"‽" + // interrobang
"※" // reference mark
// escape punctuation characters for regular expression
PUNCTUATION = PUNCTUATION.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
@tosbourn
Copy link

TIL asterism is a thing.

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