in reply to Finding a string not containing a string

Please wrap code in <code> tags, as the instructions above the input field stated. As you can see, your posted regex has linkified ranges because you failed to do so. See How do I post a question effectively?.

While your spec is a little odd, I interpret that to say you have a fixed Perl script that takes a string version of a regular expression as input, and applies it to some input file. If the old code applies the i modifier to your input, then you necessarily must change the code there to hit your spec. Please correct me if my understanding of the issue is incorrect.