Terms facet can have a script, without field or fields.  Regex requires ...

...either field or fields

Slight modification to the terms facet to enable you to use it without a field/fields, if you're using a script.

Modified the regex condition to conform