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