EDN Admin
Well-known member
I am creating a validation routine for our project. It is fairly simple, data will either be an integer, decimal, date or time value and will be a range or a single value to check. I dont have a problem storing these rules for validation in
my XML files. I will store the rules in a database using an XML format, the validator will pull the rule form the database based on criteria passed in, grab the high and low values, determine the type of validation to do, pass in the high and low value
to the correct validation routine and then pass in the validation value. If it is in range, it returns a true, if not, it is a false. The engine will also allow to validate against specific values which will be stored in the lowvalue of the XML
file.
However, in order to make this validation engine of real use, I need a way to create custom validation routines for strings. The best way is to create regular expression masks for the data then do a compare using the regex engine to produce a match
result. In order to create validation rules for the engine, I will have an interface that will allow the System Admins to create the rules based on specific data. For ranges not a problem, they select the type (string, int, decimal, date, time), select
a high and low value and save the rule.
But in Order to make this engine of use, I need to provide a simple way for the sys admins to put in a string mask in such a way that I could produce a regular expression mask for it and store it. For example if I needed a mask that would accept both
of these strings "U07058ZT" and "U07154Z". These are just examples of some part numbers that I would need to produce masks for. If the GUI for the validation engine could do this with little IS support that would be best. Anyone have any
suggestions?
Thanks.
View the full article
my XML files. I will store the rules in a database using an XML format, the validator will pull the rule form the database based on criteria passed in, grab the high and low values, determine the type of validation to do, pass in the high and low value
to the correct validation routine and then pass in the validation value. If it is in range, it returns a true, if not, it is a false. The engine will also allow to validate against specific values which will be stored in the lowvalue of the XML
file.
However, in order to make this validation engine of real use, I need a way to create custom validation routines for strings. The best way is to create regular expression masks for the data then do a compare using the regex engine to produce a match
result. In order to create validation rules for the engine, I will have an interface that will allow the System Admins to create the rules based on specific data. For ranges not a problem, they select the type (string, int, decimal, date, time), select
a high and low value and save the rule.
But in Order to make this engine of use, I need to provide a simple way for the sys admins to put in a string mask in such a way that I could produce a regular expression mask for it and store it. For example if I needed a mask that would accept both
of these strings "U07058ZT" and "U07154Z". These are just examples of some part numbers that I would need to produce masks for. If the GUI for the validation engine could do this with little IS support that would be best. Anyone have any
suggestions?
Thanks.
View the full article