How to do it...

The test application is shown in the following screenshot:

Figure 3.1: The RegEx recipe main form with some checks on it

Each button checks the value written to the edit at its left. The checks don't test the real validity of the data inserted. They only check the format validity (for example, if the email address is formally valid, the check returns true, even if the address doesn't really exist).

Open the recipe project called RegEx.dproj in the IDE and check the code for the form.

In Delphi, the necessary classes and records to work with regular expressions are contained in the System.RegularExpressions.pas unit and follow ...

Get Delphi Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.