Perhaps just use the Symfony Url constraint and drop this method altogether?