Skip to content

Commit 8bda319

Browse files
committed
Properly escape minus sign in regular expressions
1 parent 72d7da0 commit 8bda319

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPHtmlParser/Selector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Selector
2020
*
2121
* @var string
2222
*/
23-
protected $pattern = "/([\w-:\*>]*)(?:\#([\w-]+)|\.([\w-]+))?(?:\[@?(!?[\w-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
23+
protected $pattern = "/([\w\-:\*>]*)(?:\#([\w\-]+)|\.([\w\-]+))?(?:\[@?(!?[\w\-:]+)(?:([!*^$]?=)[\"']?(.*?)[\"']?)?\])?([\/, ]+)/is";
2424

2525
protected $selectors = [];
2626

0 commit comments

Comments
 (0)