* * 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:----wmTsF1529OTz36b3oYpk30c/pIFgyH6VskVWJhQXLiT+1PHXvvsGjm+sYCWvxNWlbOutaSJgeFkmdyRkdXrWcPTECYnZi0AHw/7DDr2G4TXcMBxxlXlzwB727xpcdDVnxvxeN2hulrRebBGUAfEZ65ad2EHym+73djeqn6pIV+FzJNdsmhP7jc8/fDolGXarHbYwAsikKefE0FC3LbyI9yI1OWcNF1A+MxL/ohxPjCQ8BjdIQCK4B0xef7IdrpzYWiCJ2tKaUfPnCLak+00gLlxFypp308vQD7dBlIQHP9VP8W0hbiaLVJ9dOe7Tw7yRS1sBypR955crgas/NMaxuuSF3B8+MiWLuPckJYAvAzNx65LmoNq55z7tf3IQyp2L+DB5rFjB6aZEzYW1jUKBHEWzADqVSG9R11/0nfDm/z8YDQIvu10pN/OUMw1/XbYlsGDJ5T1YwLmTZAw+wBSAzr82aHNw3LycTs6Pj6KRsg3nkSLCeTSTkOtrQW/vlj/EmCofC7EPd2Vlt8lDsBBHU26IGUo+dp74eXc4G0ijiorAIU5afO19c0TsD9tJPYRaOmrOLVQv9DQdWKBZe40ow6IDjlLNG1C+/BWkeRACl407Y9U5UbYGYD9+DEUZ/f8vFB3VNQPU0Znlb8t+rL3qweg6GxoVvKLV0QdRRIVPf5E=----ATTACHMENT:----Nzc4NzgyNDc4MTgzMjcwMCAxMTAwMjY2OTE5MTk5MTc3IDQzNzMzNDg0OTcyOTQ3NQ==