# same result
bash-4.2$ [[ 'test' == ?e* ]]; echo $?
0
bash-4.2$ [[ 'test' == ?x* ]]; echo $?
1
bash-4.2$ [[ 'test' =~ .e.* ]]; echo $?
0
bash-4.2$ [[ 'test' =~ .x.* ]]; echo $?
1
# but at different speed
bash-4.2$ time for x in {1..1000000}; do [[ 'test' == ?e* ]]; done
real 0m4.943s
user 0m4.899s
sys 0m0.011s
bash-4.2$ time for x in {1..1000000}; do [[ 'test' =~ .e.* ]]; done
real 0m17.056s
user 0m16.962s
sys 0m0.010s
# measure the loop's own speed to subtract it
bash-4.2$ time for x in {1..1000000}; do :; done
real 0m4.357s
user 0m4.329s
sys 0m0.009s
# to find out the times actually spent for matching
# - [[ 'test' == ?e* ]] 4.943 - 4.357 = 0.586
# - [[ 'test' =~ .e.* ]] 17.056 - 4.357 = 12.699