title: Symfony2 forms and <input> pattern attribute
body: <p>I am trying to create a form in Symfony2 with a text input field that accepts a string consisting of 6 digits followed by a dash followed by four digits (e.g. 123456-7890). It does work, but I'm getting inconsistent HTML markup depending on exactly how I add the field to the form.</p>
  
  <p>This is from the entity:</p>
  
  <pre><code>class Kursist
  {
  ...
  /**
   * @ORM\Column(type="string", length=11)
   */
  protected $cpr;
  ....
  public static function loadValidatorMetadata(ClassMetadata $metadata)
  {
      $metadata-&gt;addPropertyConstraint('cpr', new NotBlank());
      $metadata-&gt;addPropertyConstraint('cpr', new Regex(array(
          'pattern' =&gt; '/^\d{6}-\d{4}$/',
      )));
  }
  </code></pre>
  
  <p>From the form definition:</p>
  
  <pre><code>class KursistType extends AbstractType
  {
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
      $builder-&gt;add('cpr');
      ...
    }
  }
  </code></pre>
  
  <p>From the twig template:</p>
  
  <pre><code>&lt;form action= ... &gt;;
    {{ form_row(form.cpr) }}
      ...
  &lt;/form&gt;
  </code></pre>
  
  <p>This is what the browser source code looks like - note the <em>pattern</em> and <em>maxlength</em> attributes:
      <pre>&lt;label for="KursistType_cpr" class="required"&gt;Cpr&lt;/label&gt;&lt;input type="text" id="KursistType_cpr" name="KursistType[cpr]" required="required" maxlength="11" pattern="\d{6}-\d{4}" value="123456-7890" /&gt;</pre></p>
  
  <p>I want to use my own label rather than the default, so I change the form field defition:<pre>
      class KursistType extends AbstractType
      {
        public function buildForm(FormBuilderInterface $builder, array $options)
        {
          $builder->add('cpr','text', array('label' => 'CPR'));
          ...</pre></p>
  
  <p>But now when I look at the browser source code, the <em>pattern</em> and <em>maxlength</em> attributes have gone:<pre>
      &lt;label for="KursistType_cpr" class="required"&gt;CPR&lt;/label&gt;&lt;input type="text" id="KursistType_cpr" name="KursistType[cpr]" required="required" value="123456-7890" /&gt;</pre></p>
  
  <p>Is there some way to modify the label using the FormBuilderInterface without these attributes being dropped?</p>