We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2943d9f commit a27e301Copy full SHA for a27e301
lib/Sabberworm/CSS/Property/Selector.php
@@ -38,7 +38,13 @@ class Selector {
38
/ix';
39
40
const SELECTOR_VALIDATION_RX = '/
41
- ^((?:[a-zA-Z0-9\x{00A0}-\x{FFFF}_\^\$\|\*\=\"\'\~\[\]\(\)\-\s\.:#\+\>]*(?:\\\\.)?(?:\'.*?\')?(?:\".*?\")?)*|\s*?[\+-]?\d+\%\s*)$
+ ^(
42
+ (?:
43
+ [a-zA-Z0-9\x{00A0}-\x{FFFF}_^$|*="\'~\[\]()\-\s\.:#+>]* # any sequence of valid unescaped characters
44
+ (?:\\\\.)? # a single escaped character
45
+ (?:([\'"]).*?(?<!\\\\)\2)? # a quoted text like [id="example"]
46
+ )*
47
+ )$
48
/ux';
49
50
private $sSelector;
0 commit comments