The Vitamin C library (yes, I’m dating myself) allowed a “picture” to define the input pattern, e.g.,
$###,###.## (with “right-to-left” entry before the decimal point, and left-to-right after)
(999) 999-9999x9999
Aaaaaaaaaa
The input field stayed formatted as you typed, the cursor was controlled for you (by default), so there was no ambiguity whatsoever. Paste in a pre-formatted value, e.g., “$31,071”, as from a PDF, and it would accept it, no problem. (We can’t do that with the current text field; it blanks as soon as you tab away.)
Unfortunately I am working in a network project with lots of specified text formats and I would not prefer to do the format checkups via multiple if cases. That is why I would prefer a simple regex check.
I can agree, that regex can be hard at first. I was there as well, but the more you use it the easier it becomes. In addition most of the special formats I work with were already specified on websites like stackoverflow. So there isn’t that much of work needed as others would think.
In the few cases when I want auto formatting I use the Validator.
Using it only for auto formatting wouldn’t be as simple as the property you are requesting, but since I’m using it already for input validation, adding the auto formatting is pretty simple.