Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

tosbourn commented Apr 30, 2014

TIL asterism is a thing.

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