但是掩码字符串不如正则表达式那么灵活。
But mask strings are not as flexible as regular expressions.
您可以使用与这里相同的技巧来从一个本地化的ResourceBundle中获得掩码字符串。
You could retrieve the mask string from a localized ResourceBundle using the same technique defined here.
如果一个掩码字符串足以处理一组本地化数据类型,那么从ResourceBundle获得掩码字符串就是本技巧的一个很好的用途。
If a mask string can do what you need for a set of localized data types, retrieving the mask strings from ResourceBundles is a great use of this technique.
应用推荐