So... given that the validation method here is quite straighforward (a regex), how hard would it be to change things so that you could store the regex in one place in the Python code and then include it in this template?

I assume there's also a similar validation error message somewhere in the Python code.

I'm not familiar with this code at all so maybe it doesn't make sense.