To disable a previously enabled mode, we can place a hyphen (-) before the modifier symbol anywhere in your regular expression.
Let's look at some examples.
To disable DOTALL, we can use the following regex:
(?-s)
To disable ignore case matching, we can use the following regex:
(?-i)
To disable the MULTILINE mode, we can use the following regex:
(?-m)
To disable both ignore case and MULTILINE mode, we can use the following regex:
(?-im)
To disable the ignore case, DOTALL, and MULTILINE modes, we can use the following regex:
(?-ism)