The patterns in the input (see lref(Rules Section)(rulessection)) are
written using an extended set of regular expressions. These are:

itemization(
ittn(x)
    match the character `x'

it() bf(.)nl()
    any character except newline;

ittn([xyz])
   a character class; in this case, the pattern matches either an `x', a `y',
    or a `z'.  See also the paragraph about character classes below;

ittn([abj-oZ])
    a ``character class'' with a range in it; matches an `a', a `b', any
    letter from `j' through `o', or a `Z'.  See also the paragraph about
    character classes below; 

ittn([^A-Z])
   a ``negated character class'', i.e., any character but those in the class.
    In this case, any character EXCEPT an uppercase letter.  See also the
    paragraph about character classes below; 

ittn([^A-Z\n])
   any character EXCEPT an uppercase letter or a newline.  See also the
    paragraph about character classes below; 

ittn([:predef:])
   a em(predefined) set of characters. See below for an overview. When used,
    it is interpreted as an element in a character class. Consequently, it is
    always embedded in a set of square brackets defining the character class
    (e.g., tt([[:alnum:]]));

ittn(s1{+}s2)
   If tt(s1) and tt(s2) are character classes: the union of the characters in
    tt(s1) and tt(s2);

ittn(s1{-}s2)
   If tt(s1) and tt(s2) are character classes: the set-difference of the
    characters in tt(s1) minus the characters in tt(s2);

ittn("[xyz]\"foo")
    the literal string `tt([xyz]"foo)';

ittn(R"([xyz]\"foo)") the literal string `tt([xyz]\"foo)' (using a raw string
    literal). Raw string literals using labels (which must be identifiers,
    e.g., tt(R"label( labelled raw string )label") are also supported;

ittn(R"label("(xyz"))label")
    the literal string  `tt("(xyz"))' (using a labeled rawstring);

ittn(\X)
   if X is `a', `b', `f', `n', `r', `t', or `v', then the ANSI-C
    interpretation of `\x'. Otherwise, a literal `X' (used to escape operators
    such as `*');

ittn(\0)
    a NUL character (ASCII code 0);

ittn(\123)
    the character with octal value 123 (i.e., decimal 83);

ittn(\x2a)
    the character with hexadecimal value 2a (i.e, decimal 42);

ittn((r))
   a regular expression tt(r) by itself. It is used to override precedence
    (see below);

ittn({name})
   the expansion of the `name' definition (see also section ref(FILEFORMAT));

ittn(r*)
    zero or more tt(r)s, where r is any regular expression;

ittn(r+)
    one or more tt(r)s;

ittn(r?)
    zero or one tt(r)s (that is, an optional r);

ittn(rs)
   the regular expression `r' followed by the regular expression `s'. This is
    called concatenation;

ittn(r{m, n})
   where tt(0 <= m <= n): match `r' at least m, but at most n times; called
    interval expression; A regular expression to which tt({0, 0}) is appended
    is ignored, and a warning message is shown;

ittn(r{m,})
    where tt(0 <= m): match `r' m or more times;

ittn(r{m})
    where tt(0 <= m): match `r' exactly m times; A regular expression to which
    tt({0}) is appended is ignored, and a warning message is shown;

ittn(r|s)
    either an `r' or an `s';

ittn(r/s)
   an `r' but only if it is followed by an `s'. The text matched by `s' is
    included when determining whether this rule is the longest match, but is
    then returned to the input before the action is executed. So the action
    only sees the text matched by `r'. This type of pattern is called trailing
    context. The tt(/)-character is commonly referred to as the em(lookahead
    operator).

   A warning is generated when the tt(r)-pattern may match no text. This is a
    potentially dangerous situation. Consider this pattern
        verb(
    a*/b
        )
   with input tt(b). This input matches tt(a*/b), but tt(b) is pushed back on
    to the input stream. Then the process is repeated, resulting in a
    continuous loop. 

   If flc() detects patterns potentially not matching any text it generates 
    warnings like this:
        verb(
    [Warning] input, line 7: null-matching regular expression
        )
    By placing the comment
        verb(
    //%nowarn
        )
   on the line just before a regular expression that potentially does not
    match any text, the warning for that regular expression is suppressed;

ittn(^r) 
   `r', if appearing at the beginning of a line (i.e., when just starting
    to scan, or right after a newline has been read). When tt(r) appears
    elsewhere on a line it isn't matched by this rule; if the tt(^)-character
    is not the first character of a regular expression it is interpreted as a
    plain tt(^)-character;

ittn(r$)
   an `r', if it appears at the end of a line (i.e., the next character on the
    input stream is a newline character). The expression tt(r$) is equivalent
    to the expression `tt(r/\n)'. When tt(r) appears
    elsewhere on a line it isn't matched by this rule; if the tt($)-character
    is not the last character of a regular expression it is interpreted as a
    plain tt($)-character. A dollar-terminated regular expression, however,
    may be followed by an action or vertical bar indicating that the regular
    expression uses the same action as the next rule;

ittn(<s>r)
    an `r', but only in start condition s (cf. section ref(STARTCONDITIONS));

ittn(<s1,s2,s3>r)
    same, but in any of start conditions s1, s2, or s3;

ittn(<*>r)
    same, but tt(r) is used in any start condition;

ittn(<sc-list>{compound rules})
   all rules defined in em(compound rules) are active in the set of start
    conditions specified at em(sc-list). Rules defined in em(compound rules)
    cannot themselves specify start conditions. em(Compound rules) may contain
    empty lines;

ittn(<<EOF>>)
    matches `end-of-file';

ittn(<sc-list><<EOF>>)
    an end-of-file when in the start conditions specified at em(sc-list).
)

bf(Character classes)

Inside a character class all regular expression operators lose their special
meanings, except for the escape character (tt(\)), the character range
operator tt(-), the end of character class operator tt(]), and, at the
beginning of the class, tt(^). All ordinary escape sequences are supported,
all other escaped characters are interpreted as literal characters (e.g.,
tt(\c) is a literal tt(c)).

To add a closing bracket to a character class use tt([]) or tt(\]). To add a
closing bracket to a negated character class use tt([^]) (or use tt([^)
followed by tt(\]) somewhere within the character class). Minus characters are
used to define character ranges (e.g., tt([a-d]), defining tt([abcd])) except
in the following cases, where flc() recognizes a literal minus character:
    tt([-), or tt([^-) (a minus at the very beginning of a character class); 
    tt(-]) (a minus at the very end of a character class); 
    or tt(\-) (an escaped minus character))
 Once a character class has started, all
subsequent character (ranges) are added to the set, until the final closing
bracket (tt(])) has been reached.

bf(Operator precedence)

The operators used in specifying regular expressions have the following
priorities (listed from lowest to highest):

itemization(
ittn(|) 
    when used to separate patterns sharing the second pattern's actions;

itt(^r) and tt(r$):nl()
   tt(^): at the beginning of a regular expression tt(r): tt(r) only matches
    when encountered at the beginning of a line;nl()
   tt($): at the end of a regular expression tt(r): tt(r) only matches when
    encountered at the end of a line;

ittn(/)
   the look ahead operator;

ittn(|)
   the alternatives (`or') operator;

ittn(rs)
   concatenation of regular expressions tt(r) and tt(s);

ittn(multipliers)
    tt(*, +, ?) and the interval specification (i.e., tt({...}));

ittn({+}, {-}) 
   (In the context of character classes).  The set union and set difference
    operators;

ittn((r)) 
   (Parentheses). Here, r may be any regular expression (not containing the
    look-ahead operator).
)

Different from the lex-standard, but in line with most other regular
expression engines the interval operator is given higher precedence than
concatenation. To require two repetitions of the word tt(hello) use
tt((hello){2}) rather than tt(hello{2}), which to flc() is identical to the
regular expression tt(helloo).

Named regular expressions have the same precedence as parenthesized regular
expressions. So after
        verb(
    WORD  xyz[a-zA-Z]
    %%
    {WORD}{2}
        )
    the input tt(xyzaxyzb) is matched, whereas tt(xyzab) isn't.

In addition to characters and ranges of characters, character classes can also
contain predefined character sets. These consist of certain names between
tt([:) and tt(:]) delimiters. The predefined character sets are:
verb(     
         [:alnum:] [:alpha:] [:blank:]
         [:cntrl:] [:digit:] [:graph:]
         [:lower:] [:print:] [:punct:]
         [:space:] [:upper:] [:xdigit:]
)
    These predefined sets designate sets of characters equivalent to the
corresponding standard bf(C) tt(isXXX) function. For example, tt([:alnum:])
defines all  characters for which tt(isalnum) returns true.

As an illustration, the following character classes are equivalent:
    verb( 
         [[:alnum:]]
         [[:alpha:][:digit:]]
         [[:alpha:][0-9]]
         [a-zA-Z0-9]
    )

Note that a negated character class like tt([^A-Z]) matches a newline unless
tt(\n) (or an equivalent escape sequence) is one of the characters explicitly
present in the negated character class (e.g., tt([^A-Z\n])). This differs from
the way many other regular expression engines treat negated character classes.
Matching newlines means that a pattern like tt([^"]*) can match the entire
input unless there's another quote in the input.

Flc() allows negation of character class expressions by prepending tt(^) to
the name of a predefined character set. Here are the negated predefined
character sets:
    verb(                
         [:^alnum:] [:^alpha:] [:^blank:]
         [:^cntrl:] [:^digit:] [:^graph:]
         [:^lower:] [:^print:] [:^punct:]
         [:^space:] [:^upper:] [:^xdigit:]
    )      

The `tt({+})' operator computes the union of two character classes. For
example, tt([a-z]{+}[0-9]) is the same as tt([a-z0-9]).

The `tt({-})' operator computes the difference of two character classes. For
example, tt([a-c]{-}[b-z]) represents all the characters in the class
tt([a-c]) that are not in the class tt([b-z]) (which in this case, is just the
single character `tt(a)'). 


A rule can have at most one instance of trailing context (the tt(/) operator
or the tt($) operator). The start condition, tt(^), and tt(<<EOF>>)
patterns can only occur at the beginning of a pattern, and, as well as with
tt(/) and tt($), cannot be grouped inside parentheses. A tt(^) which does not
occur at the beginning of a rule or a tt($) which does not occur at the end of
a rule loses its special properties and is treated as a normal character.

The following are invalid:
    verb(                
         foo/bar$
         <sc1>foo<sc2>bar
    )     
Note that the first of these can be rewritten `foo/bar\n'.

If the desired meaning is a `foo' or a `bar'-followed-by-a-newline, the
following could be used (the special | action is explained below, see section
ref(actions)):

    verb(                
         foo      |
         bar$     /* action goes here */
    )      
    A comparable definition can be used to  match a `foo' or a
`bar'-at-the-beginning-of-a-line.
