Regular Expression (REGEX)

What is a Regular Expression (REGEX)?

A regular expression (REGEX) is a sequence of characters that defines a search pattern, used to find, match, and manipulate text.

Regular expressions are widely used in text editors, programming languages, and other software applications to search for and work with text that matches a particular pattern.

What are regular expressions used for?

A regular expression lets you check whether text meets certain criteria - for instance, that it is a certain length, contains only certain characters, or matches a specific format. They are powerful and versatile tools, although they can take some time to learn.

Here are some simple examples:

REGEXDescriptionMatchesDoes Not Match
^BOOKMust start with "BOOK"BOOKEDBLUEBOOK
ING$Must end with "ING"BOOKINGBOOKED
BOOKINGMust contain "BOOKING"YOUR BOOKING DETAILSYOU BOOKED
^BOOKING$Must be exactly "BOOKING"BOOKINGYOUR BOOKING
\dMust contain a digit2 BOOKINGSTWO BOOKINGS
\DMust not be only digitsTWO BOOKINGS2 BOOKINGS
^BOOK\d\d$"BOOK" followed by exactly two digitsBOOK43BOOKING43

Regular expressions in MIDAS

In MIDAS, regular expressions can be used to validate entries in custom input fields, ensuring data is entered in exactly the format you require. For more examples, see our guide How to use Regular Expressions for custom input validation.

Glossary »