title: Adding REGEX entities to SpaCy's Matcher
body: <p>I am trying to add entities defined by regular expressions to SpaCy's NER pipeline.  Ideally, I should be able to use any regular expression loaded from a json file with a defined entity type.  As an example, I am trying to execute the code below.</p>
  
  <p>The code below shows what I am trying to do, following an example given on Spacy's discussion about custom attributes using regular expressions.  I have tried calling the 'set_extension' method in various ways (to Doc, Span, Token), but to no avail.  I'm not even sure what I should be setting them to.</p>
  
  <pre><code>    nlp = spacy.load("en_core_web_lg")
      matcher = Matcher(nlp.vocab)
      pattern = [{"_": {"country": {"REGEX": "^[Uu](\.?|nited) ?[Ss](\.|tates)$"}}}]
      matcher.add("US", None, pattern)
      doc = nlp(u"I'm from the United States.")
      matches = matcher(doc)
      for match_id, start, end in matches:
          string_id = nlp.vocab.strings[match_id]
         span = doc[start:end]
         print(match_id, string_id, start, end, span.text)
  </code></pre>
  
  <p>I expect <code>match_id, string_id 3 4 United States</code> to be printed out. </p>
  
  <p>Instead, I am getting <code>AttributeError:  [E046] Can't retrieve unregistered extension attribute 'country'.  Did you forget to call the 'set_extension' method?</code></p>