From 3f9cebcecb0c8797fb25a8225103965719fc9f0f Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Wed, 13 Sep 2017 18:34:54 +0200 Subject: [PATCH] Require that a regex has some content Otherwise, the `//` that start a comment could be misread as regexes. Fixes #196 --- src/JS.php | 2 +- tests/js/JSTest.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/JS.php b/src/JS.php index 250c625..4f5202d 100644 --- a/src/JS.php +++ b/src/JS.php @@ -242,7 +242,7 @@ protected function extractRegex() (isset($match['after']) ? $match['after'] : ''); }; - $pattern = '(?P\/.*?(?\/(.|\\\\)+?((?