as an extension of http://inmysocks.tiddlyspot.com “Search all fields by content” I want to restrict the selection of fields by checkbox. So I end up with the following code:
There was a lot that needed tweaking. I don’t know if Discourse did it, or the editor you were using, or your keyboard, but there were quote mark mismatches that usually only occur if you’re using something like Word. They had to be replaced everywhere. I’ve never seen the syntax /$for$/ for field, so assume Jed is using his own field filter. There were also mismatched widget tags.
This worked for me though lightly tested. Keep in mind that you need to initialize your checkboxes once in order to create the fields (i.e. check them on and off once).
It’s actually an example of an old but now deprecated syntax for expressing the operand of a filter as a regular expression:
[field/bo+k/]
The problem with the syntax is that individual operators have to be aware of and handle the possibility of a regexp operand themselves. We only got as far as implementing it for the “field” operator before realising that it was a dead end, and introducing the “regexp” operator instead.