Search for [[]]

Hello all,

I have created a problem for myself and need to fix it. A macro I created has created some fields that have [[]] as a value and nothing else. How might I search on these and delete them? I think that this might be able to be done with regexp, but I’m not familiar enough to know for sure. Any advice is most welcome and appreciated.

If that happened to me, I’d do the following:

  1. Make a backup.
  2. MAKE A BACKUP.
  3. Load the html file in a text editor.
  4. Search for <script class="tiddlywiki-tiddler-store
      – your tiddlers are stored in that <script> element
  5. Find the relevant entries and change "[[]]" to ""
  6. Save & test.

Good luck!

Put the following in a tiddler:

<$vars brackets="[[]]">
<$list filter="[all[tiddlers]search:-text<brackets>]"><$link/></$list>

Notes:

  • The $vars is needed since you can’t directly use square brackets as a literal operand value in filter syntax, but you can use a <variable> reference that contains the square brackets.
  • The -text flag in the search operator means “search all fields EXCEPT the text field”

enjoy,
-e

2 Likes

Thanks to you both. I ended up using Eric’s solution and it worked fine.

I’m normally pretty good at doing backups, but brain farted in this case.