I am holding in a field the validation format that I would need. I need to convert different ## into a regex validation.
Is there a simple replace that can do this for me. for example, i need to validate the account number. sometimes it might need to be ###-###, or I'll get ####### or ##-####. depending what is in the id="validationrule" field I'm looking for
regex = $('#validationrule').replace("#", "[0/9]");
It also has to take into consideration that sometimes there is a dash in there.