Skip to content

Commit

Permalink
Fixed issue with capturing strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
hexydec committed Nov 23, 2022
1 parent f0c824c commit 706a53c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jslite.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class jslite {
'number' => '(?:0[bB][01_]++n?|0[oO][0-7_]++n?|0[xX][a-f0-9_]|[0-9][0-9_]*+(?:\\.[0-9_]++)?+(?:e[+-]?[1-9][0-9]*+)?+)',

// consume strings in quotes, check for escaped quotes
'doublequotes' => '"(?:\\\\.|[^\\\\"])*+"',
'singlequotes' => "'(?:\\\\.|[^\\\\'])*+'",
'templateliterals' => '`(?:\\\\.|[^\\\\`])*+`',
'doublequotes' => '"(?:\\\\.|[^\\"])*+"',
'singlequotes' => "'(?:\\\\.|[^\\'])*+'",
'templateliterals' => '`(?:\\\\.|[^\\`])*+`',

// capture single line comments after quotes incase it contains //
'commentsingle' => '\\/\\/[^\\n]*+',
Expand Down

0 comments on commit 706a53c

Please sign in to comment.