I'm trying to set the same phone regex everywhere on my website, using a pattern defined in the app/config/parameters.yml
parameters:    
    phone_regex: /^[+][3][3]\d{9}$/
How can i retrieve this patern in my entities assert annotations ?
/**
 * @var string
 * @Assert\NotBlank(message = "notBlank")
 * @Assert\Regex(
 *     pattern="%phone_regex%",
 *     message="phone"
 * )
 * @ORM\Column(name="contact_phone", type="string", length=255)
 */
private $contactPhone;
The code above does not work, it generates html without the regex
<input type="text" id="client_contactPhone" name="client[contactPhone]" required="required" maxlength="255" pattern=".*phone_regex.*" class="form-control">
 
     
    