<div dir="ltr">It was just a thought so that the developer doesn&#39;t have to handle such cases himself.<br>regards<br>Alaa Nassef<br><br><div class="gmail_quote">On Wed, Jun 24, 2009 at 11:19 AM, Hardy Ferentschik <span dir="ltr">&lt;<a href="mailto:hibernate@ferentschik.de">hibernate@ferentschik.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">If you want to allow the empty string you can start your regular expression with the &#39;empty&#39; or operator &#39;|&#39;, eg &quot;|^.*foo.*$&quot;.<br>

Now the string can be empty or anything with foo in it.<br><font color="#888888">
<br>
--Hardy</font><div><div></div><div class="h5"><br>
<br>
On Wed, 24 Jun 2009 09:47:56 +0200, Alaa Mohsen &lt;<a href="mailto:alaa.mohsen@egyptdc.com" target="_blank">alaa.mohsen@egyptdc.com</a>&gt; wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello All,<br>
I just realized that PatternValidator checks if the String passed to it<br>
is null or not before checking it&#39;s validity, but it doesn&#39;t check if the<br>
String is empty. What if someone wants to put a regular expression<br>
constraint on a non mandatory field, and the framework he uses sets this<br>
empty field to an empty string? What do you think?<br>
</blockquote>
<br>
<br>
</div></div></blockquote></div><br></div>