# Regex Model

Regex models provide a flexible control for defining the exact format of the strings that you are interested in by allowing you to define the characters you want to find via a regular expression.

To use a regex model, do the following:

1. After adding the tool, configuring the ROI and setting the character Feature Size, process the tool (press the Book icon).

2. To create your regex model, from the Tool menu, select Edit Models, and from the Model Editor dialog, select Regex Model.

3. Define your regular expression in the Regex field.

   Note:
   - When constructing your regular expression, the simplest wildcard is the period; it means "match any single character." You can then use modifiers after characters or wildcards to specify how many characters to match.
   - The minimum match length for the regex model is three characters (not including the space character) or longer.
4. The regex model will return the characters that match your regular expression within the ROI. The matched characters must lie along a single horizontal line, which is defined by using the Angle parameter, and is the allowable deviation from the horizontal axis of the ROI.
5. Close the dialog by pressing the X button in the top-right corner of the dialog.
6. The model will then be applied to the view that was open when the Model Editor was launched.
7. Process the tool (press the Book icon) to apply the model to the rest of the views.
8. Review the results. For more information, refer to the Working with Labels and Models topic.