#1106335 grep: non-sensical matches - "over-matching"

Package:
grep
Source:
grep
Description:
GNU grep, egrep and fgrep
Submitter:
Sunny73Cr
Date:
2025-05-23 02:19:01 UTC
Severity:
normal
#1106335#5
Date:
2025-05-23 01:56:03 UTC
From:
To:
PATH_TEST="../../dir/dir/dir/dir/@#$%^&*()-_=+\\|;:'\",<.>/?/";
echo "$PATH_TEST" | grep "^\.\?\.\?\([a-zA-Z0-9@#$%^&*()-_=+\|;:'",<>/?]\+\)\+/\?$";

. is not within the character set portion of the match specification provided to grep.
../../ is matched; I expect it to match only '../', therefore no match for the line.
. is also matched in the ,<.> portion toward the end of the path.

SOURCE="[[]]";
echo "$SOURCE" | grep "[[]]\+"

The very first [ is not matched in this string.
grep "[\[\]]\+" does not match it either.

Regards,
sunny

#1106335#10
Date:
2025-05-23 02:17:18 UTC
From:
To:
System used is Debain 12.9, no updates.
Bash is the shell in use; it may play a part in interpreting "" strings.

Regards,
sunny