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
?
match "anything including newline" without DOTALL?
You can try with Character Classes or Character Sets
[\s\S]+
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With