Regular Expression ^ $ Python?
<p>i'm just a little confused about the combination of ^ with $. I understand </p>

<p>that it means start and end respectively and then () means extract specifically </p>

<p>what's inside the parenthesis. But why would it print no in this example. please </p>

<p>help with an explanation. thank you</p>

<pre><code>if re.search('^(0|1)$', '0b'):
    print 'yes'
else:
    print 'no'
</code></pre>