How to match anything (DOTALL) without DOTALL?

Ahmed Fasih

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?

Joren485

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

How to match "anything up until this sequence of characters" in a regular expression?

From Dev

How to specify the end of the line with the dotall modifier in PHP?

From Dev

How to match anything before and after a pattern in awk?

From Dev

how to use dotall flag for regex.exec()

From Dev

How to match anything up to a sequence of characters in a group

From Dev

How do you match multiple lines with dot (DOTALL) in eclipse find regex

From Dev

gsub across multiple lines in R (dotall)

From Dev

Using DOTALL breaks re.sub after replacing multiple times

From Dev

How do I replace Pattern.DOTALL by using a String.replaceAll function?

From Dev

python re.sub newline multiline dotall

From Dev

How to match anything except two or more consecutive spaces in a regex?

From Dev

Regex match anything up to word - without non-greedy operators

From Dev

Non-greedy newline character match with re.DOTALL

From Dev

pattern.dotall is not working in between \Q and \E

From Dev

How to match anything in a regular expression up to a character and not including it?

From Dev

How to specify the end of the line with the dotall modifier in PHP?

From Dev

Regexp flag DOTALL in sed or alternatives

From Dev

how to use dotall flag for regex.exec()

From Dev

About the efficiency of re:run with "dotall" option?

From Dev

using regular expressions across multiple lines (DOTALL / MULTILINE)

From Dev

How to match anything up to a sequence of characters in a group

From Dev

Non greedy dotall regex in Python

From Dev

How to find match in sequence with nested sets? (or nested anything else)

From Dev

How to match a word followed by anything in Notepad++

From Dev

Java regular expression dotall

From Dev

How do I replace Pattern.DOTALL by using a String.replaceAll function?

From Dev

Parsing a log into record blocks with Powershell RegEx DOTALL and a lookbehind assertion

From Dev

Regex with DOTALL, how to make it stop at some point?

From Dev

Can somebody tell me how can this regular expression match anything?

Related Related

  1. 1

    How to match "anything up until this sequence of characters" in a regular expression?

  2. 2

    How to specify the end of the line with the dotall modifier in PHP?

  3. 3

    How to match anything before and after a pattern in awk?

  4. 4

    how to use dotall flag for regex.exec()

  5. 5

    How to match anything up to a sequence of characters in a group

  6. 6

    How do you match multiple lines with dot (DOTALL) in eclipse find regex

  7. 7

    gsub across multiple lines in R (dotall)

  8. 8

    Using DOTALL breaks re.sub after replacing multiple times

  9. 9

    How do I replace Pattern.DOTALL by using a String.replaceAll function?

  10. 10

    python re.sub newline multiline dotall

  11. 11

    How to match anything except two or more consecutive spaces in a regex?

  12. 12

    Regex match anything up to word - without non-greedy operators

  13. 13

    Non-greedy newline character match with re.DOTALL

  14. 14

    pattern.dotall is not working in between \Q and \E

  15. 15

    How to match anything in a regular expression up to a character and not including it?

  16. 16

    How to specify the end of the line with the dotall modifier in PHP?

  17. 17

    Regexp flag DOTALL in sed or alternatives

  18. 18

    how to use dotall flag for regex.exec()

  19. 19

    About the efficiency of re:run with "dotall" option?

  20. 20

    using regular expressions across multiple lines (DOTALL / MULTILINE)

  21. 21

    How to match anything up to a sequence of characters in a group

  22. 22

    Non greedy dotall regex in Python

  23. 23

    How to find match in sequence with nested sets? (or nested anything else)

  24. 24

    How to match a word followed by anything in Notepad++

  25. 25

    Java regular expression dotall

  26. 26

    How do I replace Pattern.DOTALL by using a String.replaceAll function?

  27. 27

    Parsing a log into record blocks with Powershell RegEx DOTALL and a lookbehind assertion

  28. 28

    Regex with DOTALL, how to make it stop at some point?

  29. 29

    Can somebody tell me how can this regular expression match anything?

HotTag

Archive