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)
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.