title: Codeigniter Routing Regex
body: <p>I have a site with multiple languages. For my news page I have two rules to route the pagination variable to my controller. One for all the languages (en, ct, cs, kr), and one for the default language.</p>
  
  <h1>Routes.php</h1>
  
  <pre><code>$route['^(en|ct|cs|kr)/news/page/(:num)'] = 'news/index/$1';
  $route['news/page/(:num)'] = 'news/index/$1';
  </code></pre>
  
  <h1>News controller</h1>
  
  <pre><code>public function index($id) 
  {
     echo $id; 
  }
  </code></pre>
  
  <p>The routes are accessing the news controller, however the <code>$id</code> parameter isn't being passed to the <code>index()</code> method. </p>
  
  <p>If I echo the <code>$id</code> it returns the language segment rather than the pagination variable I am expecting:</p>
  
  <blockquote>
    <p>mysite.com/en/news/page/2  // $id returns 'en'.<br>
    mysite.com/kr/news/page/2  // $id returns 'kr'.</p>
  </blockquote>
  
  <p>It works when I write the routes out individually for each language:</p>
  
  <blockquote>
    <p>$route['en/news/page/(:num)'] = 'news/index/$1';</p>
  </blockquote>
  
  <p>Am I going wrong somewhere with my regex?</p>