'Check that the value is a string and matches the pattern.'

def convert(self, value, view):

    if isinstance(value, BASESTRING):
        if (self.pattern and (not self.regex.match(value))):
            self.fail(u'must    match    the    pattern    {0}'.format(self.pattern), view)
        return value
    else:
        self.fail(u'must    be    a    string', view, True)
