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