title: How can I suppress zsh pattern escaping during string expansion?
body: <p>I am trying to port this snippet of code from <code>bash</code> to <code>zsh</code>:</p>
  <pre><code>#! /usr/bin/env bash  # change zsh
  
  set -x
  
  pattern=&quot;[ab]&quot;
  marks=&quot;a&quot;
  
  case &quot;${marks}&quot; in
     ${pattern})
        echo match
     ;;
  esac
  </code></pre>
  <p>This prints &quot;match&quot;.</p>
  <p><strong>Bash</strong> replaces <code>${pattern}</code> as is and then uses <code>[ab]</code> to match either <code>'a'</code> or <code>'b'</code>.</p>
  <p><strong>zsh</strong> seemingly escapes the <code>'[]'</code> characters and then uses <code>\[ab\]</code> to match this string verbatim.</p>
  <p>I don't see a zsh option, how to change the behavior and hardcoding the pattern is not an option.</p>