RadDataForm - Match regex only if value is not empty


#1

I have a field for which I need input in a particular format but I don’t have the required attribute on it. Which means either I don’t need the value in that field or I need it it in a particular format. But it doesn’t seem to be working. The validator pops up an error for the field if its blank. How can I accept blank values here?

<df:EntityProperty name="pan" displayName="PAN Number" index="11">
      <df:EntityProperty.validators>
             <df:RegExValidator regEx="\w{5}\d{4}\w{1}" errorMessage="Enter a valid PAN Number"/>
      </df:EntityProperty.validators>
</df:EntityProperty>