To match a trailing dot at the end of an outline label:
\.$
The \ is needed to escape the dot so that it is
parsed literally (instead of as a dot operator). The $
specifies that that a match is valid only if it occurs at the end of a
line.
To match a trailing exclamation mark at the end of an outline
label: !$
The exclamation mark ! does not need to be escaped
since it has no special meaning as an operator. The $
specifies that that a match is valid only if it occurs at the end of a
line.
To match chapter/paragraph numbering like "5.2.1.4", at the
start of an outline label:
^[0-9]+\.?[0-9]?\.?[0-9]?\.?[0-9]?
This will match up to four levels deep. The ^
specifies that that a match is valid only if it occurs at the start of
a line. [0-9] will match any digit from 0 to 9. The
+ symbol indicates that the match must occur one or
more times. The ? symbol indicates that a match may
occur 0 or more times. Finally, the \ is used to
escape characters that have special meaning, like the dot, to be
interpreted literally.
For information on using ICU Regular Expressions see:
http://www.icu-project.org/userguide/regexp.html