GtkSourceView - Gedit/regex101: regex matching discrepancy
I try to use this RegEx ^(\[\^)([^\]\s\p{C}]+)(\])\ (\P{C}*(?:\n(?!\n[\[\n])\P{C}*)*)
in dar.lang (located at /usr/share/gtksourceview-3.0/language-specs
) to capture footnotes with multiple paragraphs (that i.a. terminate with 2 empty lines, i.e. 3 \n
).
When I open Gedit I see that this RegEx in dar.lang
highlights only the first paragraph of the [^1]... footnote (ignoring the last two):
However when I use the very same RegEx in the Gedit's "Find" dialog (need to press the magnifying glass icon and activate "Match as Regular Expression") then it matches perfectly:
I get the same results even if I replace both occurrences of \P{C}*
with .*
in the RegEx...
regex101 behaves correctly and captures footnotes with multiple paragraphs just as Gedit's Find dialog does.