Your comments

if regex not checked, why not treat \ as literal?

or copy notepad++. Normal (literal), Extended (\n \r \t..), Regex

or vs code. Normal (literal), Regex