Syntax for sequential search-replace regexp

I’m trying to perform two regex search-replace sequentially and getting stumped. I suspect it is a syntax problem, but can’t figure it out.

I have a field named kp_2 with its value:

Ineffable = Too great [or extreme to be expressed in words.]
Ephemeral = [Lasting for a very short time;] transient.
Serendipity = [The occurrence of events by chance in a happy or] beneficial way.
Labyrinth = [A complicated irregular network of passages or paths;] a maze.
Quintessential = [Representing the most perfect or] typical example [of something.]
Euphoria = [A feeling or state of] intense excitement and happiness.

I want to show all content to the right of the ‘=’ and exclude the content in [ ]. Expected results:

Too great transient. beneficial way. a maze. typical example intense excitement and happiness.

I’m getting:

Too great [or extreme to be expressed in words.] [Lasting for a very short time;] transient. [The occurrence of events by chance in a happy or] beneficial way. [A complicated irregular network of passages or paths;] a maze. [Representing the most perfect or] typical example [of something.] [A feeling or state of] intense excitement and happiness.

This is what I have so far:

<table>
  <$list filter="[<currentTiddler>fields[]prefix[kp_]]" variable=fieldname>
    <$list filter="[<currentTiddler>get<fieldname>]" variable=field-value>
      <tr><td class=dots><$text text={{{ [<fieldname>removeprefix[kp_]] }}} /></td>
      <td class=data>

        <$vars reg="[.*?]" >
          <$list filter="[<fieldname>match[kp_2]]">
            <$text text = {{{ [<field-value>search-replace:gim:regexp[^.*?=(.*)\n*],[$1]search-replace:gim:regexp[<reg>],[]] }}} />
            <br>
          </$list>
        </$vars>
      </td></tr>
    </$list>
  </$list>
</table>

What is the best way to accomplish this?

Try

search-replace:gim:regexp<reg>,[]

I can’t go much further without more time.

1 Like