Put a space after the `!` character, as per our [styleguide](http://ellislab.com/codeigniter/user-guide/general/styleguide.html). Also, to avoid the need of escaping forward slashes, you could just use another delimiter, i.e.:

    #^https?://#i