Hi,

It seems the rule of quoted literals doesn't apply if the RHS is a variable. So a variable with a quoted "." would try to match a quote followed by . followed by another quote.
If you wanted to match a quote in a literal RE you would have to write "."
The following Bash snippet illustrates:

#!/bin/bash                                                                     
                                                                                 
v=0                                                                             
for r in '^a.b$' '^a"."b$' "^a'.'b$"; do                                       
  ((v++))                                                                       
  # matches var 1 only                                                          
  [[ a.b =~ $r ]] &amp;&amp; echo match var $v                                          
  # matches var 2 only                                                          
  [[ 'a"."b' =~ $r ]] &amp;&amp; echo match double quote $v                             
  # matches var 3 only                                                          
  [[ "a'.'b" =~ $r ]] &amp;&amp; echo match single quote $v                             
  # all 3 match                                                                 
  eval "[[ a.b =~ $r ]] &amp;&amp; echo match eval $v"                                  
done 

I find the numerous ways of testing in Bash confusing. I have to look up the manual every time I come back to Bash scripting. I hope posting about it will help keep it in the brain.

--Mad