I am trying to make validation for an html input by assigning via javascript a regex using the following code:

```
$("#"+field.field_id).attr("data-validation",'custom');
$("#"+field.field_id).attr("data-validation-regexp",field.regex);

```

If I set the regex to 

```
^(Server (\d{1,2}))$

```

Then it works only with input 'Server ..'
But i want the input Server to work with case insensitive. Like 'SERVER' or 'sErver'......
I tried to put ^(Server (\d{1,2}))$/i but it doesn't work. Any ideas ?