From 8a01d383b01118000f3c38cbd9d5cdeb3ad76f3a Mon Sep 17 00:00:00 2001 From: Brett Zamir Date: Tue, 22 Oct 2019 04:54:56 +0800 Subject: [PATCH] Support "u" and "s" flags (#97) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#Parameters --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index cf51deb..4f0dad8 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -33,7 +33,7 @@ options.files = files.reduce((files, file) => { //If the isRegex flag is passed, convert the from parameter to a RegExp object if (isRegex) { - const flags = from.replace(/.*\/([gimy]*)$/, '$1'); + const flags = from.replace(/.*\/([gimyus]*)$/, '$1'); const pattern = from.replace(new RegExp(`^/(.*?)/${flags}$`), '$1'); try { options.from = new RegExp(pattern, flags);