Unfortunately, DecimalFormat uses its own template language .
You can get the template string as follows:
DecimalFormat nf = (DecimalFormat) NumberFormat.getCurrencyInstance();
Which of my system returns "¤#,##0.00"
You may be able to flip your own function, which converts it to a regular expression (limited to the cases that are used in your application), but this is not in the standard library, and I do not know any third-party library does this.
finnw source share