Regex issue in PHP: DB vs String

It must depend on the pattern. Stuff inside of double quotes gets interpreted so there might be a difference between '\n' and "\n" but if this is so I’m very surprised I never got bit by it before.