Bash 3.2.57 (on macOS 12.6.8) extended glob pattern negation is not working in parameter substitution:
$ shopt -s extglob
$ s=abc
$ echo ${s##!(a)*}
I expected the last command to output abc, but it didn't output anything.
How can I make the third line output nothing if the first character of $s is not 'a', but output $s if the first character is 'a'?
See
And from
man bash:So here the anything can be a null string. (I think Bash's manual could be more explicit about this.)