Closed
Description
query parameter requirements regex:
/**
* @Route(
* "/search/{mac}",
* name="MediaAccessControlVendorLookupSearch",
* requirements={"mac" = "(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\2){4}[[:xdigit:]]{2}"}
* )
*/
public function searchAction($mac) {
...
}
this will end in this exception
An exception has been thrown during the rendering of a template ("Warning: preg_match(): Compilation failed: reference to non-existent subpattern at offset 66...
thats right, but i have to use the referenz "\2", the routeMatcher need this behaivor
if (0 === strpos($pathinfo, '/vendorLookup/search') && preg_match('#^/vendorLookup/search/(?P<mac>(?:[[:xdigit:]]{2}([-:]))(?:[[:xdigit:]]{2}\\2){4}[[:xdigit:]]{2})$#s', $pathinfo, $matches)) {
so what is to do ?