If you're only going to be doing a small number of searches on a short string, you can use the i flag for everything without significantly slowing your program. If you're going to be doing a large number of searches and/or the string to be searched is very long, you're better off making a copy and upper or lowercasing everything so you don't have to use i at all.
Either way, I wouldn't come at the problem from this direction.