punctuation-regex
Version:
Regular expression for matching punctuation characters.
15 lines (12 loc) • 432 B
JavaScript
/*!
* punctuation-regex <https://github.com/regexps/punctuation-regex>
*
* Copyright (c) 2016 Jon Schlinkert.
* Licensed under the MIT license.
*/
;
module.exports = function(extended) {
return extended === true
? /^[\‒\–\—\―|$&~=\\\/⁄@+*!?({[\]})<>‹›«».;:^‘’“”'",،、`·\•†‡°″¡¿※#№÷×%‰\−‱¶′‴§_‖¦]+$/
: /^[!"#$%&'()*+,./:;<=>?@\^_`{|}~\-]+$/;
};