title: javax @Pattern validation regex for characters size range
body: <p>I am implementing server side validation for my REST service. In below class I have imposed javax size validation. The problem is that the size validation fires even when address1 is null or zero length string. I want the size validation to occur only when address1 contains some text, if it is empty then I don't want size validation to come into effect.</p>
  
  <pre><code>    import javax.validation.constraints.Size;
      import javax.xml.bind.annotation.XmlElement;
  
      public class Address {
  
          private String address1;
  
          @XmlElement(name="address1")
          @Size(min=1, max=50, message="address1")
          public String getAddress1() {
              return address1;
          }
  
          public void setAddress1(String address1) {
              this.address1 = address1;
          }
  
      }
  </code></pre>
  
  <p>I am thinking of using @Pattern in place of @size. What is the regex for it?</p>