The https://www.gnu.org/software/m4/manual/html_node/Regexp.html states:
The syntax for regular expressions is the same as in GNU Emacs, which is similar to BRE, Basic Regular Expressions in POSIX. See Syntax of Regular Expressions in the GNU Emacs Manual.
So I jump to https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexps.html , then navigate to the next page https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-Backslash.html , which states:
sc
matches any character whose syntax is c. Here c is a character that designates a particular syntax class: thus, ‘w’ for word constituent,
And also mentions character classes. But these do not work in m4, like:
$ m4 <<<'changequote(<,>)patsubst(<a b c d>, <[[:space:]]>, <r>)'
a b c d
$ m4 <<<'changequote(<,>)patsubst(<a b c d>, <sw>, <r>)'
a b c d
But s
works. Where is it in documentation?
$ m4 <<<'changequote(<,>)patsubst(<a b c d>, <s>, <r>)'
arbrcrd
What are GNU m4 regex engine rules?