You can escape metacharacters in regular expressions using \Q and \E. Have a look at quotemeta.
In reply to Re: Compare two arrays by hdb in thread Compare two arrays by kaushik9918