You can register a validation rule using the datatypes.xml file.
This method of registering a validation rule can only be used for parameter value inputs. The datatype for a parameter is deduced using the datatypes map. And the parameter value is validated using the validation rules registered against that datatype.
<DataType Name="Address" Size="70" Type="NVARCHAR">
<UIType Size="30" UITableSize="30"/>
<Validation>
<Regex JavaPattern="<pattern>" JSPattern="<pattern>" allowNull="false"/>
<Impl JavaClass="com.sterlingcommerce.test.MyRuleClass"
JSFunctionName="myJavascriptFunction"/>
</Validation>
</DataType>
<DataType Size="5" Name="Pincode" Type="NUMBER">
<Validation>
<Regex MaxLength="200" MinLength="3" JavaPattern="^[a-zA-Z0-9.,!\-/+=:]*$" JSPattern="^[a-zA-Z0-9.,!\-/+=_ :]*$" allowNull="true"/>
</Validation>
</DataType>