My regexp needs both the default non-newline-matching dot and the re.DOTALL
dot (.
matches newline). I need several of the former and just one of the latter within a single regexp. Nevertheless, because I need one dot to match newlines, I have to use DOTALL
, and use [^\n]
several times to get the default "anything except newlines" behavior.
I'd like to get rid of the DOTALL
, replace those [^\n]
with .
and have a more complicated way of matching "anything including newlines" in the one place that I need.
So the question is: what is the regexp syntax to match "anything including newline" without DOTALL
?
I always use r"[\s\S]"
all whitespace and non-whitespace, so everything.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments