title: Regex to match only two specific words, e.g. Yes or No
body: <p>My attempt is:</p>
  
  <pre><code>^Yes|^No|^$ 
  </code></pre>
  
  <p>but when I use this, words other than "Yes" and "No" are matched</p>
  
  <p>How do I fix it? </p>
  
  <p>I've been testing my regex using <a href="http://regex101.com/">this online regex tester</a>.</p>