title: AutoFixture creating a property with regex rule
body: <p>I have recently applied <a href="https://gist.github.com/dperini/729294" rel="nofollow">this</a> regex pattern attribute to one of the properties in my class in order to evaluate valid url formats. The problem has now occurred that AutoFixture cannot create an instance of it displaying the error </p>
  
  <blockquote>
    <p>"AutoFixture was unable to create an instance from
    Ploeh.AutoFixture.Kernel.RegularExpressionRequest, most likely because
    it has no public constructor, is an abstract or non-public type."</p>
  </blockquote>
  
  <p>I have tried a few suggestions like</p>
  
  <pre><code>var contact = _fixture.Build&lt;ContactEntity&gt;()
     .With(c=&gt;c.Customer.Website,
       new SpecimenContext(_fixture)
         .Resolve(new RegularExpressionRequest(Constants.UrlRegex)))
     .Create();
  </code></pre>
  
  <p>and </p>
  
  <pre><code>public class WebsiteSpecimenBuilder: ISpecimenBuilder
  {
      public object Create(object request,
      ISpecimenContext context)
      {
          var pi = request as PropertyInfo;
  
          if (pi!=null &amp;&amp; pi.PropertyType == typeof(string) 
              &amp;&amp; (pi.Name.Equals("Email") || pi.Name.Equals("Website")))
          {
              //tried both of these options
              return (new OmitSpecimen() || "http://www.website.com";
          }
  
          return new NoSpecimen(request);
      }
  }
  </code></pre>
  
  <p>But i still can't get autofixture to create the class. Am i missing something to get it to create or is this regex too complex for autofixture to handle?</p>