title: ASP.NET MVC - Regex for a URL Slug
body: <p>I am writing a URL Slug for routing. Should I leave the slug constraint blank or what?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>routes.MapRoute(
                  null,
                  "q/{slug}/{id}",
                  new { controller = "q", action = "Index" },
                  new { id = @"^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$" }
              );
  </code></pre>
  
  <p>The slug will be in this format</p>
  
  <pre><code>how_do_you_open_jar_file_on_computer
  </code></pre>