title: Filter with regex MongoDB C# driver
body: <p>I am trying to match the fields of <code>originalEmail</code> with a mail address like liron@gmail.com, but no matter, case sensitive means to also find LirOn@gmail.com fields.</p>
  
  <pre><code>public ObjectId? GetEntityIdByOriginalEmail(string originalEmail)
  {
      FilterDefinition&lt;Entity&gt; filter = "{ x : { $regex : /" + originalEmail + "//i } }";
      var entity = _entitiesStorage.GetSingleOrDefault(filter);
  
      if (entity == null)
          return null;
  
      return entity._id;
  }
  </code></pre>
  
  <p>This didn't work for me. Why?</p>