Trying to understand FieldEditorFilter

I am following the tiddler here:
https://tiddlywiki.com/#Customizing%20EditTemplate%20field%20rendering

And I am trying to target a field named ‘category’.

This works as intended:
[regexp[category]then[$:/_/EditTemplate/fieldEditor/category]]
(targets only the field named as category)

but this does not:
[has:field[category]then[$:/_/EditTemplate/fieldEditor/category]]

Why not?

and this targets all the fields irrespective of their names:
[[category]then[$:/_/EditTemplate/fieldEditor/category]]

why?

A FieldEditorFilter (tagged with $:/tags/FieldEditorFilter) is part of a cascade (see https://tiddlywiki.com/#Cascades).

The input to this type of filter is a field name.

Thus, in your first example, using regexp[category] matches any field that has “category” in it’s name.

However, your second example, using has:field[category] doesn’t work because the input is a field name, not a tiddler title.

Your third example, using [category] is a literal text value that is, by definition, always “true”. Thus, the filter is always applied, regardless of the field name that is input to the filter.

-e

Thank you, Eric. It’s much clearer now. I looked up the filter operators list to see which other operator can I use instead of regexp, and the only one which I can find is the match operator. I tried it and it works (but the whole name of the field has to match, unlike regexp, which clearly is more versatile). Am I correct or is there some other one can use?