Hi! I’m trying to write a regexp filter that will allow me to copy-paste various texts with the same formatting and convert them in tiddlers with their content distributed in fields. Probably more than a hundred of them, so it’s worth it for me to automatize the process instead of creating them manually.
During this, I stumbled upon a strange behaviour. One of the search-replace operator examples doesn’t seem to work on any wiki I use (I’m currently usind tiddloid lite for the project).
https://tiddlywiki.com/#search-replace%20Operator%20(Examples)
It is the sixth example, which says that:
To replace everything but a match using a regular expression and the multiline (m) flag:
\define myregexp2() ^(?!Unlike).*$
[[HelloThere]get[text]search-replace:gm:regexp<myregexp2>,[]]
It does in fact work over there, cutting out everything up to the “Unlike” lookahead match.
However, as you can see in this test tiddlywiki, it doesn’t work; the search-replace filter doesn’t affect its source in any way:
https://searchreplaceregexp.tiddlyhost.com/#Example
I’m experimenting but I can’t find what’s wrong here. My guess is that it has to do with the negative (!) lookahead somehow not being read.