preg_match in twig

First of all, I know that the logic should be in the controller and not in the view and I keep it that way. But in this particular situation I need to use preg_match within a ternary operation to set …