Previously trailing garbage (for example) would have been ignored.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
echo "$str" | sed 's/^\(.*\)/ \1/' 1>&2 || exit $?
echo "Against:" 1>&2 || exit $?
echo "$rx" | sed 's/^\(.*\)/ \1/' 1>&2 || exit $?
- if [[ "$str" =~ $rx ]]; then
+ if [[ "$str" =~ ^${rx}$ ]]; then
echo "! $src regex matches ok" 1>&2 || exit $?
else
echo "! $src regex doesn't match FAILED" 1>&2 || exit $?