title: Reference a Set of File Paths Using a Regular Expression
body: <p>Can I do one read to disk with a regular expression instead of doing this three times?</p>
  
  <pre><code>var path = HttpContext.Current.Server.MapPath(string.Format("~/Assets/Images/{0}.png", id)); 
  
  if (!File.Exists(path))
  {
      path = HttpContext.Current.Server.MapPath(string.Format("~/Assets/Images/{0}.jpg", id));
  
      if (!File.Exists(path))
      {
          path = HttpContext.Current.Server.MapPath(string.Format("~/Assets/Images/{0}.gif", id));
  </code></pre>