Skip to content

Commit 70b18f1

Browse files
Chhandak.Baruatedivm
Chhandak.Barua
authored andcommitted
To identify coorect end of the regex
1 parent 962daa7 commit 70b18f1

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/JShrink/Minifier.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -626,7 +626,7 @@ protected function saveRegex()
626626
$this->echo($this->b);
627627

628628
while (($this->a = $this->getChar()) !== false) {
629-
if ($this->a === '/' && (preg_match('/g|\n|i|\.|,|\s/', $this->peek()) === 1)) {
629+
if ($this->a === '/' && (preg_match('/g|\n|i|\)|\.|,|\s/', $this->peek()) === 1)) {
630630
break;
631631
}
632632

Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,
2-
'\\$1'
3-
)
4-
}
1+
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,'\\$1')}

0 commit comments

Comments
 (0)