Saturday, December 24, 2005

Validate localized data with regular expressions

Validate localized data with regular expressions: "Validate localized data with regular expressions

Using ResourceBundles to check local data formats
developerWorks

Level: Introductory

Doug Tidwell (dtidwell@us.ibm.com), Senior Programmer, IBM University Relations

20 Dec 2005

Data validation is a common chore in programming any user interface. The Java? language's regular-expression support can make data validation easier. You can define a regular expression that describes valid data and then let the Java runtime see if it matches. But certain types of data have different formats in different locales. The ResourceBundle class lets you work with locale-specific data in an elegant way. This article shows how to combine the two techniques to solve a common data-entry problem."

No comments: