I am new at unix, I'm trying to learn the bash language, and when I went to the "Testing expression", I found this one:
[[ "whatever" =~ h[aeiou] ]]
I already read the answer to this question, so I understand what the operator =~ does. After running the previous command, the output of echo $? is 0, meaning the condition inside the [[ ]] is met. If instead I type
[[ "whatever" =~ h[sdfghjkl] ]]
the output of echo $? is 1, so the condition was not met.
So, I would like to know what the h[aeiou] and h[sdfghjkl] are.
Is h a predefined function inside the [[ ]] expression? And if so, what is it doing? If not, what h[aeiou] and h{sdfghjkl] actually are?
Thanks.