* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Parser\Shortcut; use Symfony\Component\CssSelector\Node\ElementNode; use Symfony\Component\CssSelector\Node\HashNode; use Symfony\Component\CssSelector\Node\SelectorNode; use Symfony\Component\CssSelector\Parser\ParserInterface; /** * CSS selector hash parser shortcut. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class HashParser implements ParserInterface { /** * {@inheritdoc} */ public function parse($source) { // Matches an optional namespace, optional element, and required id // $source = 'test|input#ab6bd_field'; // $matches = array (size=4) // 0 => string 'test|input#ab6bd_field' (length=22) // 1 => string 'test' (length=4) // 2 => string 'input' (length=5) // 3 => string 'ab6bd_field' (length=11) if (preg_match('/^(?:([a-z]++)\|)?+([\w-]++|\*)?+#([\w-]++)$/i', trim($source), $matches)) { return array( new SelectorNode(new HashNode(new ElementNode($matches[1] ?: null, $matches[2] ?: null), $matches[3])), ); } return array(); } } __halt_compiler();----SIGNATURE:----NAVO930OqAw0bU5akskA1tQKe2Gq6CIwWwvvb/dFUzL5FZo1llQCsu5dpRK/Wm/VMr1Mf1yPBq1dn9Vwbbm54rkKRsJLV8Mu4oNsDuLfLudUFd7A3M/hqLUk9hOXSV0O67b/8hNg3V6022d60WPR+NSyNIoGclcxK9lER3ESnNM8V9DMV9Nzzt+bmi3UoNwluuhf+BK8RR3W8vVw6If6B+Ap5R/xMEj8CsBnGFjuZBRuSITxrQtddc4xCbXD4Q8kigh0EM4SG+M0PGAheN17ju8cbnNds+VviGOrMXK7NnBLuPmMylu7LGCSspPQSt/GWUMSnV0KDDTC8XUVLvvyZkoCXk7u+SJ26P1WmWbeiZqev71MDKqeeo8Rjwlcj//ZwfE6kvwT+k4YVyOkcWqQxiitYewI46IscRWlpFHZv4vdnJM2BrDK5urmeAc2ONy75bD8F7nFjmulNmUOKbvz5yx61XYHu62uvh2UI+V3z88zvX27yOSdimOzcyIybcx+dXXXMJqQUD70PZwj/5nnu9xVNTTdMmcrKuF3KtZ9+54n5ZnzaQZBJSi3+AEbrjfznpnbmx9gZSh69qebYnrQ14cC2EF21jjg10Lr08G+znbf1tj70V2CwQ9N8ITFMqDZmlOVHbzGsFES7JHXdOx7zhWRXv9gWOOYSd71qpvmX6o=----ATTACHMENT:----OTM0NDE4ODA1NDQyNTI4OSA3MzQwOTEyNDU3OTE2MDc3IDQwNjk5MjA2MjM5ODQyNDA=