Portable extended regular expressions should use @samp{\} only to escape
characters in the string @samp{$()*+.?[\^@{|}. For example, @samp{\@}}
is not portable, even though it typically matches @samp{@}}.
+In particular, even though POSIX.1-2024 says @samp{\]} matches @samp{]},
+earlier editions of POSIX say that the meaning of @samp{\]} is undefined.
The empty alternative is not portable. Use @samp{?} instead. For
instance with Digital Unix v5.0:
Similarly, the following escape sequences should also be avoided:
@samp{\<}, @samp{\>}, @samp{\+}, @samp{\?}, @samp{\`}, @samp{\'},
@samp{\B}, @samp{\b}, @samp{\S}, @samp{\s}, @samp{\W}, and @samp{\w}.
+Also, even though POSIX.1-2024 says @samp{\]} matches @samp{]},
+earlier editions of POSIX say that the meaning of @samp{\]} is undefined.
For more information about what can appear in portable regular expressions,
@pxref{Problematic Expressions,,, grep, GNU Grep}.
# -----------------------------------
# Return '1' if STRING looks like a C/C++ type.
m4_define([_AC_CHECK_TYPE_MAYBE_TYPE_P],
-[m4_bmatch([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|\]\)*$],
+[m4_bmatch([$1], [^[_a-zA-Z0-9 ]+\([_a-zA-Z0-9() *]\|\[\|]\)*$],
1, 0)dnl
])# _AC_CHECK_TYPE_MAYBE_TYPE_P
ETAGS_FOR_M4 = \
--lang=none \
- --regex='/\(m4_define\|define\)(\[\([^]]*\)\]/\2/'
+ --regex='/\(m4_define\|define\)(\[\([^]]*\)]/\2/'
ETAGS_FOR_M4SUGAR = \
$(ETAGS_FOR_M4) \
- --regex='/m4_defun(\[\([^]]*\)\]/\1/'
+ --regex='/m4_defun(\[\([^]]*\)]/\1/'
ETAGS_FOR_AUTOCONF = \
$(ETAGS_FOR_M4SUGAR) \
- --regex='/\(A[CU]_DEFUN\|AU_ALIAS\)(\[\([^]]*\)\]/\2/' \
- --regex='/AN_\(FUNCTION\|HEADER\|IDENTIFIER\|LIBRARY\|MAKEVAR\|PROGRAM\)(\[\([^]]*\)\]/\2/'
+ --regex='/\(A[CU]_DEFUN\|AU_ALIAS\)(\[\([^]]*\)]/\2/' \
+ --regex='/AN_\(FUNCTION\|HEADER\|IDENTIFIER\|LIBRARY\|MAKEVAR\|PROGRAM\)(\[\([^]]*\)]/\2/'
## -------------------------------- ##
AT_CHECK([[$EGREP '^AC_OUTPUT$' configure.ac]],
[0], [ignore])
-AT_CHECK([[$EGREP '^AC_CONFIG_FILES\(\[Makefile\]\)$' configure.ac]],
+AT_CHECK([[$EGREP '^AC_CONFIG_FILES\(\[Makefile]\)$' configure.ac]],
[0], [ignore])
AT_CLEANUP
AT_CHECK([[$EGREP '^AC_''OUTPUT$' configure.ac]],
[0], [ignore])
-AT_CHECK([[$EGREP '^AC_''CONFIG_FILES\(\[Makefile\]\)$' configure.ac]],
+AT_CHECK([[$EGREP '^AC_''CONFIG_FILES\(\[Makefile]\)$' configure.ac]],
[0], [ignore])
-AT_CHECK([[$EGREP '^AC_''CONFIG_COMMANDS\(\[default\]' configure.ac]],
+AT_CHECK([[$EGREP '^AC_''CONFIG_COMMANDS\(\[default]' configure.ac]],
[0], [ignore])
AT_CLEANUP