Skip to content

Commit

Permalink
Change: Allow global and sticky flag in regular expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
iorate committed Feb 10, 2019
1 parent 494f328 commit 74a848d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ const compileBlockRule = raw => {
try {
const compiled = new RegExp(re[1], re[2]);
if (compiled.global || compiled.sticky) {
console.warn('Unsupported regular expression flag: ' + raw);
return null;
return new RegExp(re[1], re[2].replace(/[gy]/g, ''));
}
return compiled;
} catch (e) {
Expand Down

0 comments on commit 74a848d

Please sign in to comment.