Book Image

Delphi Cookbook

By : Daniele Teti
Book Image

Delphi Cookbook

By: Daniele Teti

Overview of this book

Table of Contents (14 chapters)
Delphi Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Checking 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 the 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/XE6/en/Regular_Expressions.

With regular expressions, 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 change the SQL in your code over...