[Mesa-dev] [PATCH v2] configure.ac: Use POSIX word boundary regex.
Jan Beich
jbeich at freebsd.org
Sun Mar 19 13:44:30 UTC 2017
Vinson Lee <vlee at freedesktop.org> writes:
> - -e 's/[[[:space:]]]+-DNDEBUG\>//g' \
> - -e 's/[[[:space:]]]+-D_GNU_SOURCE\>//g' \
> - -e 's/[[[:space:]]]+-pedantic\>//g' \
> + -e 's/[[[:space:]]]+-DNDEBUG[[[:space:]]]//g' \
> + -e 's/[[[:space:]]]+-D_GNU_SOURCE[[[:space:]]]//g' \
> + -e 's/[[[:space:]]]+-pedantic[[[:space:]]]//g' \
If you always expect whitespace on both sides but trim it the RE
may not match with more than one occurence in sequence e.g.,
$ echo ' -D_GNU_SOURCE -DNDEBUG ' |
sed -E -e 's/[[:space:]]+-DNDEBUG[[:space:]]//g' \
-e 's/[[:space:]]+-D_GNU_SOURCE[[:space:]]//g'
-D_GNU_SOURCE
vs. (restore some whitespace)
$ echo ' -D_GNU_SOURCE -DNDEBUG ' |
sed -E -e 's/[[:space:]]+-DNDEBUG[[:space:]]/ /g' \
-e 's/[[:space:]]+-D_GNU_SOURCE[[:space:]]/ /g'
More information about the mesa-dev
mailing list