Using regular expression to define masks
Firstly I have to say I love the package. The method of defining mask is rather limited. I would like to suggest that you use regular expressions to define the input masks. Yes I do know that JavaScript regular expression, although very fast and powerful does not have the capability that is required.
Your package inspired me to help you out with that. This use case needs a somewhat different api and capability in regular expressions:
- Incremental processing - that is, regular expression what checks against part of the string
- Lets you know the state of the match
- DONE - the entire expression has been patched
- MORE - the match is incomplete and requires more input
- MAYBE - the mach is complete but will take more input
- It will generate a mask for the remaining characters in the input
- Support most if not all the capabilities of JavaScript regular expression
I am in the process of creating such a package. I have written the initial version and it is passing all the tests that I have; but I cannot say that it is complete.
Incremental Regular Expression
I have still work to do making it into a full node package. Please have a look and specially at the test that I have. Currently I am passing all my 80 or so tests; but clearly this is far from exhaustive.
I have a working version of regular expression based masked input. The only thing you have to enter is a regular expression rather than a mask.
Too bad your nice demo requires Bootstrap...