xref: /freebsd/contrib/netbsd-tests/lib/libc/regex/README (revision d8a0fe102c0cfdfcd5b818f850eff09d8536c9bc)
1regular expression test set
2Lines are at least three fields, separated by one or more tabs.  "" stands
3for an empty field.  First field is an RE.  Second field is flags.  If
4C flag given, regcomp() is expected to fail, and the third field is the
5error name (minus the leading REG_).
6
7Otherwise it is expected to succeed, and the third field is the string to
8try matching it against.  If there is no fourth field, the match is
9expected to fail.  If there is a fourth field, it is the substring that
10the RE is expected to match.  If there is a fifth field, it is a comma-
11separated list of what the subexpressions should match, with - indicating
12no match for that one.  In both the fourth and fifth fields, a (sub)field
13starting with @ indicates that the (sub)expression is expected to match
14a null string followed by the stuff after the @; this provides a way to
15test where null strings match.  The character `N' in REs and strings
16is newline, `S' is space, `T' is tab, `Z' is NUL.
17
18The full list of flags:
19  -	placeholder, does nothing
20  b	RE is a BRE, not an ERE
21  &	try it as both an ERE and a BRE
22  C	regcomp() error expected, third field is error name
23  i	REG_ICASE
24  m	("mundane") REG_NOSPEC
25  s	REG_NOSUB (not really testable)
26  n	REG_NEWLINE
27  ^	REG_NOTBOL
28  $	REG_NOTEOL
29  #	REG_STARTEND (see below)
30  p	REG_PEND
31
32For REG_STARTEND, the start/end offsets are those of the substring
33enclosed in ().
34