xref: /freebsd/contrib/netbsd-tests/lib/libc/regex/README (revision 4f1efa309ca48a088595dd57969ae6a397dd49d1)
157718be8SEnji Cooperregular expression test set
257718be8SEnji CooperLines are at least three fields, separated by one or more tabs.  "" stands
357718be8SEnji Cooperfor an empty field.  First field is an RE.  Second field is flags.  If
457718be8SEnji CooperC flag given, regcomp() is expected to fail, and the third field is the
557718be8SEnji Coopererror name (minus the leading REG_).
657718be8SEnji Cooper
757718be8SEnji CooperOtherwise it is expected to succeed, and the third field is the string to
857718be8SEnji Coopertry matching it against.  If there is no fourth field, the match is
957718be8SEnji Cooperexpected to fail.  If there is a fourth field, it is the substring that
1057718be8SEnji Cooperthe RE is expected to match.  If there is a fifth field, it is a comma-
1157718be8SEnji Cooperseparated list of what the subexpressions should match, with - indicating
1257718be8SEnji Cooperno match for that one.  In both the fourth and fifth fields, a (sub)field
1357718be8SEnji Cooperstarting with @ indicates that the (sub)expression is expected to match
1457718be8SEnji Coopera null string followed by the stuff after the @; this provides a way to
1557718be8SEnji Coopertest where null strings match.  The character `N' in REs and strings
1657718be8SEnji Cooperis newline, `S' is space, `T' is tab, `Z' is NUL.
1757718be8SEnji Cooper
1857718be8SEnji CooperThe full list of flags:
1957718be8SEnji Cooper  -	placeholder, does nothing
2057718be8SEnji Cooper  b	RE is a BRE, not an ERE
2157718be8SEnji Cooper  &	try it as both an ERE and a BRE
2257718be8SEnji Cooper  C	regcomp() error expected, third field is error name
2357718be8SEnji Cooper  i	REG_ICASE
2457718be8SEnji Cooper  m	("mundane") REG_NOSPEC
2557718be8SEnji Cooper  s	REG_NOSUB (not really testable)
2657718be8SEnji Cooper  n	REG_NEWLINE
2757718be8SEnji Cooper  ^	REG_NOTBOL
2857718be8SEnji Cooper  $	REG_NOTEOL
2957718be8SEnji Cooper  #	REG_STARTEND (see below)
3057718be8SEnji Cooper  p	REG_PEND
31*4f1efa30SKyle Evans  P	REG_POSIX
3257718be8SEnji Cooper
3357718be8SEnji CooperFor REG_STARTEND, the start/end offsets are those of the substring
3457718be8SEnji Cooperenclosed in ().
35