old_contents: import re
  from .text import Text
  
  
  class Email(Text):
  
      max = 254
  
      messages = {
          'type': 'Not a valid email address',
      }
  
      def validation(self, value):
          value = super(Email, self).validation(value)
          if not re.match(r'^[^@]+@[^@]+\.[^@]+$', value):
              raise self.error('type')
          return value
  
new_contents: from .text import Text
  
  
  class Email(Text):
  
      max = 254
      pattern = r'^[^@]+@[^@]+\.[^@]+$'
  
      messages = {
          'pattern': 'Not a valid email address',
      }
  
subject: Update email field to use the pattern constraint of text