Next: , Previous: Diversion support, Up: Programming in M4sugar
8.3.4 Conditional constructs  The following macros provide
additional conditional constructs as convenience wrappers around
m4_if.  — Macro: m4_bmatch (string, regex-1, value-1, [regex-2],
[value-2], ..., [default])  The string string is repeatedly
compared against a series of regex arguments; if a match is
found, the expansion is the corresponding value, otherwise, the
macro moves on to the next regex. If no regex match, then the
result is the optional default, or nothing.  — Macro:
m4_bpatsubsts (string, regex-1, subst-1, [regex-2], [subst-2],
...)  The string string is altered by regex-1 and subst-1, as if
by:            m4_bpatsubst([[string]], [regex], [subst])  The
result of the substitution is then passed through the next set
of regex and subst, and so forth. An empty subst implies
deletion of any matched portions in the current string. Note
that this macro over-quotes string; this behavior is
intentional, so that the result of each step