Metadata Parser Example

I’ve done a search on the forums and the documentation, but I can’t find an example of using regular expressions with the Metadata Parser.

Specifically, how can I force the data to be all uppercase?


I don’t think that would be possible. Python’s regex re library does not support case conversion via the \U code found on other dialects.

You best alternative are:
1- Use a validator instead.
2- Use a workflow action to manipulate the metadata value using a template.

Ok, I’ll take a look into those options.

Just so I understand correctly, the parser can only use regex commands to modify and it can’t use any of the template filters or tags?

Correct. The parser and validators are Python classes. The arguments are YAML coded which are parsed to Python values and used as keyword arguments when instantiating the parser or validator class.

Allowing templating code in the arguments is technically possible but we’ll need examine if doing so has a large performance penalty or opens up the metadata system to exploits.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.