Any idea why this regex doesnt work on Symfony Routing

  symfony, symfony-routing, symfony4

I have this regex setup

@Route("/{type}/{slug}", name="route-name", requirements={"slug"="(^(?!term/?$)^(?!anotherterm/?$).*)" })

My goal is that if slug is "term" or "anotherterm" it doesnt match this route.
I have used different regex tools and it works fine, I have also tried testing using preg_match() and it works fine. Other tools I used are below and also and

You can check here with a several automated tests and they all work only in symfony it doesnt

Results using preg_match

var_dump(preg_match("(^(?!term/?$)^(?!anotherterm/?$).*)", 'term'));
var_dump(preg_match("(^(?!term/?$)^(?!anotherterm/?$).*)", 'random-text'));


And this is the results I get from symfony

console router:match /something/random-text

 Route "router-name" almost matches but requirement for "slug" does not match ((^(?!term/?$)^(?!anotherterm/?$).*))

Doing some in-deptch research I noticed that the regex gets transformed by symfony to
#^/(?P<type>[^/]++)/(?P<slug>(?:^(?!term/?$)^(?!anotherterm/?$).*))$#sD on /symfony/routing/Route.php::compile() and then a preg_match is performed and doesnt match.

Source: Symfony Questions