* * 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\SelectorNode; use Symfony\Component\CssSelector\Parser\ParserInterface; /** * CSS selector element 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 ElementParser implements ParserInterface { /** * {@inheritdoc} */ public function parse($source) { // Matches an optional namespace, required element or `*` // $source = 'testns|testel'; // $matches = array (size=3) // 0 => string 'testns|testel' (length=13) // 1 => string 'testns' (length=6) // 2 => string 'testel' (length=6) if (preg_match('/^(?:([a-z]++)\|)?([\w-]++|\*)$/i', trim($source), $matches)) { return array(new SelectorNode(new ElementNode($matches[1] ?: null, $matches[2]))); } return array(); } } __halt_compiler();----SIGNATURE:----f5YaydM2peiReDlvwiITASHPPXNvYMpL6zj/TnLPx2r1hQ1/HKJtlx/+/tbhJKgV0rS4+/WRlWStwoQQnzB2jy+uU05vZUZnEIQO7wQlQTh1kzlmtx56oUat0NxvEs8UURWKO0fYt3AlSOECLthpjI3oS4M3b82UF8pLKRN/dmsJt7uczuefCQw90Ky/qPuW9d0+xpDoen6si0rKW8Yujx5x57X0zKWh0lJjEVWqfBbgMKxZGWq0VDbZ1hhIc1HynzMOfPFHGnSjIphDJB+4C83fDYyyQMiBAKBUoevfiRNJ43ULElk6QsxTX2j6c/VPRwXShTbbiSQtLSTqKU3YsGbEax3Jh8lrrMBtLiDMODyAbUpfdfNWlNmgeqhS+hWwT+8dYwR/sCqvcI7fL9oNXjWv5kAUjab0Is50U9sLSGaQ16JLc3WVzP3Oy27ZLp9zLgLMgIYx8VSQs2sGAPqtd/DWnqh30CXRA6UhX2Bs/VX1CC9jK6sbzqoxVvD7r2UvwDRLCPArlS/2bGy7z3fHHTfGZzDz4tmVFE799WcGlsXkrM5UmPlQzofszCId5uHK73PSDud5ZAe881YY67ROxDJDuYa5IGL71k18KiruRTQ8Epmt3oPgKSb3KKv9QR6nOrcDZcUbrRSrAxQHFhm2dBz+AphuuL/fUSXkiMtyoUM=----ATTACHMENT:----ODM5MTg1MzI4NjY2ODg3OSA5NjM1NDYwODI3ODUyNzgxIDcxMTYwODE4ODcxMzk4NDQ=