How to match anything (DOTALL) without DOTALL?
My regex needs both a point not matching a newline and a period re.DOTALL
( .
matching a newline). I need a few of the former and only one of the latter in one regex. However, since I need a single dot to match the news, I have to use DOTALL
and reuse [^\n]
multiple times to get the default "nothing but newline" behavior.
I would like to get rid of DOTALL
, replace those [^\n]
with, .
and have a more complex way of matching "nothing, including newlines" in one place that I need.
So the question is, what is the syntax of regexp to match "nothing, including a newline", without DOTALL
?
source to share