A few times I saw regex experts say that using (.|\n)*?
is a really, really bad idea.
Well, I do understand that it's better to replace it with the .*
and use the /s
flag. But sometimes the flags are not available, for example, when using regex within a text editor or other software with limited regex functionality. Thus, using something like (.|\n)*?
might be the only option for multi-line matching.
So, what are the reasons to always avoid (.|\n)*?
?