title: Regular expression: match start or whitespace
body: <p><strong>Can a regular expression match whitespace <em>or</em> the start of a string?</strong></p>
  
  <p>I'm trying to replace currency the abbreviation GBP with a £ symbol. I could just match anything starting GBP, but I'd like to be a bit more conservative, and look for certain delimiters around it.</p>
  
  <pre><code>&gt;&gt;&gt; import re
  &gt;&gt;&gt; text = u'GBP 5 Off when you spend GBP75.00'
  
  &gt;&gt;&gt; re.sub(ur'GBP([\W\d])', ur'£\g&lt;1&gt;', text) # matches GBP with any prefix
  u'\xa3 5 Off when you spend \xa375.00'
  
  &gt;&gt;&gt; re.sub(ur'^GBP([\W\d])', ur'£\g&lt;1&gt;', text) # matches at start only
  u'\xa3 5 Off when you spend GBP75.00'
  
  &gt;&gt;&gt; re.sub(ur'(\W)GBP([\W\d])', ur'\g&lt;1&gt;£\g&lt;2&gt;', text) # matches whitespace prefix only
  u'GBP 5 Off when you spend \xa375.00'
  </code></pre>
  
  <p>Can I do both of the latter examples at the same time?</p>