1.1 --- a/moinformat/parsers/common.py Wed Sep 26 23:34:52 2018 +0200
1.2 +++ b/moinformat/parsers/common.py Sun Nov 25 16:59:19 2018 +0100
1.3 @@ -26,8 +26,9 @@
1.4 # Pattern management.
1.5
1.6 ws_excl_nl = r"[ \f\r\t\v]"
1.7 -quotes = "['" '"]' # ['"]
1.8 -dotall = r"(.|\n)"
1.9 +quotes = "['" '"]' # ['"]
1.10 +dotall = r"(.|\n)" # behave similarly to dot with DOTALL option
1.11 +dotparagraph = r"(.|\n(?!\r?\n))" # match everything within paragraphs
1.12
1.13 def choice(l):
1.14
1.15 @@ -83,6 +84,7 @@
1.16
1.17 \E with a pattern for matching all characters including newlines
1.18 \N with a pattern for matching whitespace excluding newlines
1.19 + \P with a pattern for matching all characters within a paragraph
1.20 \Q with a pattern for matching quotation marks
1.21
1.22 Group names are also qualified with a pattern name prefix.
1.23 @@ -94,6 +96,7 @@
1.24 value = value.replace(r"\N", ws_excl_nl)
1.25 value = value.replace(r"\Q", quotes)
1.26 value = value.replace(r"\E", dotall)
1.27 + value = value.replace(r"\P", dotparagraph)
1.28
1.29 # Add the name to group names as a prefix.
1.30