Skip to content

Commit

Permalink
Revert "To identify coorect end of the regex"
Browse files Browse the repository at this point in the history
  • Loading branch information
tedivm authored Jun 20, 2023
1 parent 7cb41f8 commit ba35b9d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/JShrink/Minifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ protected function saveRegex()
$this->echo($this->b);

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

Expand Down
3 changes: 0 additions & 3 deletions tests/Resources/jshrink/input/regex_end_string.js

This file was deleted.

5 changes: 4 additions & 1 deletion tests/Resources/jshrink/output/regex_close.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,'\\$1')}
function test(string){return(string||'').replace(/([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g,
'\\$1'
)
}
1 change: 0 additions & 1 deletion tests/Resources/jshrink/output/regex_end_string.js

This file was deleted.

0 comments on commit ba35b9d

Please sign in to comment.