On Nov 11, 2011, at 8:11 AM, annet wrote:
> How would I write a validator validating zipcode with the following
> format: 4 digits space 2 capitals: e.g. 1000 AZ
>
> This is syntactically not correct: IS_MATCH('\d{4}\ \[A-Z]
> {2}',error_message='no match 4 digits, space, 2 capitals')
Don't escape the left bracket (and no need to escape the space). You probably
also want to anchor the search.
IS_MATCH('^\d{4} [A-Z]{2}$',error_message='no match 4 digits, space, 2
capitals')

