Skip to content

Instantly share code, notes, and snippets.

@staticor
Forked from CarlLee/punctuation.js
Created February 23, 2017 14:51
Show Gist options
  • Save staticor/2fa1aba62640d0126da9598982d160d4 to your computer and use it in GitHub Desktop.
Save staticor/2fa1aba62640d0126da9598982d160d4 to your computer and use it in GitHub Desktop.
Match punctuation in English/Chinese sentenses
var re = /([\[\]\,.?"\(\)+_*\/\\&\$#^@!%~`<>:;\{\}?,。·!¥……()+{}【】、|《》]|(?!\s)'\s+|\s+'(?!\s))/ig;
content.replace(re, '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment