I am trying to do a regular expression match with a variable that contains an asterisk.
The following set of commands in Bash does filename expansion with the asterisk in the variable on the left-hand side of the operator.
test='part1 * part2'
[[ "$test" =~ ^(.+)\ .\ (.+)$ ]] && echo $BASH_REMATCH
Results in: part1 FILE1 FILE2 part2
But it should result in: part1 * part2
I have searched and searched but cannot figure out why this is happening.