is it possible to search for the string literal “[ ]” (space in the middle) using Wikitext filter syntax? I have searched around a bit and toyed around with it but I keep getting a syntax error; do I need to use a special escape code or ULR encode it or something? let me know your thoughts; thanks.
The problem is that the [ and ] chars are used as delimiters for the filter syntax itself, so you can’t use them as literal values in a filter.
The common workaround is to define a variable containing the desired search string, and then reference that variable in the filter syntax. Something like this:
<$let myVar="[ ]">
{{{ [all[]search:text:literal<myVar>] }}}
Note that you MUST use the :literal flag or the [ and ] will be seen as separate “tokens” that will match all instances of "[" OR "]" rather than instances of exactly "[ ]"
-e
2 Likes