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.
exact
1 parent 849118e commit 5e98236Copy full SHA for 5e98236
index.js
@@ -16,8 +16,10 @@ var visa = '(?:4[0-9]{12})(?:[0-9]{3})?';
16
*/
17
18
function generate(pattern) {
19
- return function () {
20
- return new RegExp('(?:^|\\s)?(["\'])?' + pattern + '\\1', 'g');
+ return function (opts) {
+ opts = opts || {};
21
+ return opts.exact ? new RegExp('(?:^' + pattern + '$)') :
22
+ new RegExp('(?:^|\\s)?(["\'])?' + pattern + '\\1', 'g');
23
};
24
}
25
0 commit comments