
One of the main uses for regular expressions is validation, for example matching a certain pattern of characters and symbols, such as zip/postal code, telephone number, email address. Searching and replacing can be made a far more reliable process with regular expressions, being able to differentiate between matches within a word and word boundaries, such as treating "Cat" in a different way to the string "Concatenate". Finally screen-scraping is made easier by extracting only the desired information, excluding say HTML formatting.
|