Here is a variable called "target"
$ echo $_target
x86_64-linux-gnu
This regex test succeeds...
$ if [[ $_target =~ "x86_64" ]]; then echo "match"; fi
match
But it doesn't test to see if the expression is at the beginning of the line. Let me add the anchor tag to the regex:
$ if [[ $_target =~ "^x86_64" ]]; then echo "match"; fi
$
The line above doesn't indicate a match. Weird.
However, if I take off the quotes around the regular expression, all is good
$ if [[ $_target =~ ^x86_64 ]]; then echo "match"; fi
match
Why do the quotes influence the regular expression test? What am I missing in my understanding to be surprised that the second test above fails to match?