Check strings with regular expressions
A regular expression (RegEx) is a sequence of characters that forms a search pattern where some characters have a special meaning. It's mainly used to match patterns on strings. A simple case is something like this: check whether string A matches the criteria defined in string B. Regular expressions follow a specific language to define the criteria. Regular expressions are not present only in Delphi. Many languages have a regular expression library in their standard built-in library. So, if you don't know what a regular expression is, you can read the general documentation at http://en.wikipedia.org/wiki/Regular_expression and then check the Delphi-specific built-in implementation at http://docwiki.embarcadero.com/RADStudio/Regular_Expressions.
With regular expressions, perhaps you'll need an external tool to test the most complex ones (just like you want to test a complex query using a database tool instead of changing the SQL in your code over and...