Here's how I would execute a validation rule:
$('.myinput').val().match(/^[+-]?\$\d(?:\.\d\d)?$/)
The problem with your template is that it is not a fixed length, so itβs hard to code in the mask, and you may run into some people giving $ 3.5, which you donβt want. With such a pattern, I think it will be difficult not to deviate from matching regular expressions.
, , , 0,99 , (, , ...).