Regular expressions can be used to perform all types of text search and text replace operations.
In Java Script, regular expressions are often used with the two string methods: search() and replace().
Google's common Java, C and Java Script library for parsing, formatting, and validating international phone numbers.
The Java version is optimized for running on smartphones, and is used by the Android framework since 4.0 (Ice Cream Sandwich).
For example, you may want to ensure that someone inserts a valid e-mail address into a text box, or perhaps you want to ensure that someone fills in certain fields.