Skip to content

Commit c61f35f

Browse files
committed
Fix input parsing
1 parent ad958d5 commit c61f35f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/getRegExpFromString.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
export default (str) => {
1212
const oneline = str.replaceAll("\n", "").trim();
13-
const match = oneline.match(/\/(?<pattern>.*?)\/(?<flags>[a-z]+)?/);
13+
const match = oneline.match(/\/(?<pattern>.*?)\/(?<flags>[a-z]+)?$/);
1414
if (!match) {
1515
throw new SyntaxError("Invalid RegExp");
1616
}

0 commit comments

Comments
 (0)