12.4 Regular Expressions in gnatfind and gnatxref

As specified in the section about gnatfind, the pattern can be a
regular expression. Actually, there are to set of regular expressions
which are recognized by the program :

globbing patterns

These are the most usual regular expression. They are the same that you
generally used in a Unix shell command line, or in a DOS session.

Here is a more formal grammar :

regexp ::= term
term ::= elmt -- matches elmt
term ::= elmt elmt -- concatenation (elmt then elmt)
term ::= * -- any string of 0 or more characters
term ::= ? -- matches any character
term ::= [char {char}] -- matches any character listed
term ::= [char - char] -- matches any character in range

full regular expression

The second set of regular expressions is much more powerful. This is the
type of regular expressions recognized by utilities such a grep.

The following is the form of a regular expression, expressed in Ada
reference manual style BNF is as follows