Extract Text Between Two Delimiters

What is the regex pattern and the WikiText script to extract:

  1. all content between two delimiters
  2. the start delimiter is @@.red and is on its own line
  3. the end delimiter is @@

For example I have test tiddler like below

Title: test
Text:

This is @@.red Hello TW.@@ now I start another line
The second line
@@.red
I am the right section.
@@
End of this tiddler

Expected code to be completed…

<$let t="[[test]get[text]]">
<$list filter="[<t>regex<thepattern>]">

</$list>
<$let>

Expected output

I am the right section.

Check this:

<$list filter="[[test]get[text]splitregexp:m[^@@\.red]butfirst[]]
:map[splitregexp:m[@@]first[]]
">
<$text text=<<currentTiddler>> /><br>
</$list>

I assume !is[blank] after splitregexp is not required here!

1 Like