in reply to Incorrect Pattern Matching Behavior
Allow me to rewrite your regular expression so that you can see the problem more easily:
/^ThisPartDoesNotMatchAndIsInFactIrrelevantToYourProblem|OUTPUT\s*\)/Try it. With the case insensitivity, it will still match. Do you see the problem now? It can be corrected by using grouping (e.g., non-escaped parens) to specify more precisely what you really meant (update: as hv shows very nicely).
|
|---|