title: Wildcard matching in Python
body: <p>I have a class called Pattern, and within it two methods, equates and setwildcard. Equates returns the index in which a substring first appears in a string, and setwildcard sets a wild card character in a substring</p>
  
  <p>So</p>
  
  <pre><code>p = Pattern('xyz')
  t = 'xxxxxyz'
  p.equates(t)
  </code></pre>
  
  <p>Returns 4</p>
  
  <p>Also</p>
  
  <pre><code>p = Pattern('x*z', '*')
  t = 'xxxxxgzx'
  p.equates(t)
  </code></pre>
  
  <p>Returns 4, because * is the wildcard and can match any letter within t, as long as x and z match.
  What's the best way to implement this?</p>