We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 14c7e3b commit 32a44c1Copy full SHA for 32a44c1
index.js
@@ -7,6 +7,8 @@
7
8
'use strict';
9
10
-module.exports = function() {
11
- return /^[!"#$%&'()*+,./:;<=>?@\^_`{|}~-]+$/;
+module.exports = function(extended) {
+ return extended === true
12
+ ? /^[\‒\–\—\―|$&~=\\\/⁄@+*!?({[\]})<>‹›«».;:^‘’“”'",،、`·\•†‡°″¡¿※#№÷×%‰\−‱¶′‴§_‖¦]+$/
13
+ : /^[!"#$%&'()*+,./:;<=>?@\^_`{|}~\-]+$/;
14
};
test.js
@@ -22,4 +22,9 @@ describe('punctuation-regex', function() {
22
assert(regex().test('/'));
23
assert(regex().test('*'));
24
});
25
+
26
+ it('should match extended punctuation characters', function () {
27
+ assert(!regex().test('‘'));
28
+ assert(regex(true).test('‘'));
29
+ });
30
0 commit comments