Using regex in the zero plugin, syntax error?

I’m trying to use the Zero plugin to blank out all the genre tags in my library that are NOT set to “christmas”. In my configuration file I have enabled the plugin, put a configuration section for it in, and have this line:

genre: [^(?!christmas).*]

When I go to run beets again, just a query to start, it returns with the following error:

configuration error: /home/username/.config/beets/config.yaml could not be read: while parsing a flow sequence
  in "/home/username/.config/beets/config.yaml", line 23, column 12
expected ',' or ']', but got '?'

Can I not use lookaround regex in beets?

Interestingly that is technically valid YAML, even though at a glance I’d have said it’s probably not right.

Could you try quoting the field like so and see if that fixes it?

genre: '[^(?!christmas).*]'
2 Likes seems to treat it as invalid (which uses pyyaml behind the scenes like beets), even though most other sites/parsers don’t have a problem with it. It seems like the issue it has is specifically with question marks: Allow question marks inside of plain scalars in flow collections · Issue #128 · yaml/pyyaml · GitHub

1 Like

Quoting it got rid of the error message, and after some testing the plugin is working as I expect now. Thank you @jackwilsdon