title: Need a Javascript regex expression to match a language param in URL
body: <p>I'm not familiar with regex and I haven't found any proper solution for my case.
  My website utilizes such URLs:</p>
  
  <pre><code>(http(s)://www.)website.com/en/someURL
  (http(s)://www.)website.com/anotherURL
  (http(s)://www.)website.com/de/anotherURL
  </code></pre>
  
  <p>If <code>website.com/someURL</code>, <code>website.com/</code> or <code>website.com</code> is accessed the default language will be loaded.</p>
  
  <p>I need a regex which will allow only these certain language codes, case sensitivity is not important:</p>
  
  <pre><code>(http(s)://www.)website.com/en
  (http(s)://www.)website.com/en/
  (http(s)://www.)website.com/
  (http(s)://www.)website.com
  (http(s)://www.)website.com/de
  (http(s)://www.)website.com/de/
  </code></pre>