GtkSourceView: RegEx issues
- From: Sim Tov <smntov gmail com>
- To: gnome-devtools gnome org
- Subject: GtkSourceView: RegEx issues
- Date: Mon, 30 Aug 2021 18:53:24 +0300
Hello,
I try to implement in GtkSourceView this (properly working) RegEx:
As you can see there the second footnote [^1] ... spans over several paragraphs and all are captured by the RegEx.
<!-- Examples:
[^note_name] note body
RegEx: ^(\[\^)([^\s\p{C}\]]+)(\])\ ([\P{C}\n]*?)(?=\n\[|\n\n\n|\Z)
-->
<context id="note">
<match extended="true">
^(\[\^) # Opening bracket and the caret at line begin.
([^\s\p{C}\]]+) # note_name.
(\]) # Closing bracket.
\ ([\P{C}\n]*?) # One space and note body.
(?=\n\[|\n\n\n|\Z) # Till a new note (i.e. new line + opening bracket) or three new lines or end of string.
</match>
<include>
<context sub-pattern="1" class="no-spell-check" style-ref="note-marker"/>
<context sub-pattern="2" class="no-spell-check" style-ref="note-name"/>
<context sub-pattern="3" class="no-spell-check" style-ref="note-marker"/>
<context sub-pattern="4" style-ref="note-body"/>
</include>
</context>
However only the first paragraph of [^1]... is captured and not the rest... Here is how it looks:
Is it a bug in GtkSourceView or me doing something wrong?
Thank you!
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]