On Wed, Jun 7, 2023 at 1:38 AM Bruno Haible <br...@clisp.org> wrote: > Jim Meyering wrote: > > regenerate regex to reflect new functions in xalloc.h > > How did you do that? By hand, or using some of the techniques from [1] or [2]?
Hi Bruno, the comments just above include the commands I ran to create the resulting regular expression: perl -lne '/^(?:extern )?(?:void|char) \*?(\w+) *\(/ and print $1' lib/xalloc.h \ | sort | perl -MRegexp::Assemble -le \ 'print Regexp::Assemble->new(file => "/dev/stdin")->as_string'|sed 's/\?://g' However, I expect that it will be better to skip the regexp optimization (that perl module is not always installed) and just use a simple '|'d list of tokens, because that can all be done at test time using portable tools.