Regexp -i flag not working? Help :(

Hi guys, sorry if im posting this in the wrong section. I am trying to validate a string given from the URI. I have a form, on submit javascript redirects the browser to a url with the given string as a parameter (i’m using url_rewrite).

In English it works with upper & lower case. But with other languages sometimes the lowercase works and mostly it doesn’t. It works for ëç for example, but doesn’t work for something like σδφ even though it works for its uppercase version, ΣΔΦ.

Here is all the code:

function regCheck($var){
  if(preg_match($allowed, $var)){
    return true;
	return false;

echo 'get: ' . $_GET['search'] . '<br />';

  echo 'matched<br />';
}elseif($_GET['search'] == ''){
  echo 'empty<br />';
  echo 'didn\\'t match';

<script type="text/javascript">
  <!-- hide
  function submitForm(that){
	window.location = "http://localhost/search/" + that.searchString.value;
	return false;

<form onSubmit="return submitForm(this)">
  <input class="searchInput" type="text" name="searchString" />
  <input class="searchButton" type="submit" value="Search" />
RewriteRule ^search/([^/]+)/?$ test.php?search=$1 [L]

Anyone has an idea why? Could it be that regexp doesn’t know which is the lowercase version of these letters so it fails?

Thanks in advance

I figured it out i was missing a “u” flag!