input: Write a python function to validate data against a field and a regex pattern.
  assert validate({'name': 'John', 'email': 'john@example.com'}, 'email', r'^\S+@\S+\.\S+$') is None
  assert validate({'name': 'John', 'phone': '123-456-7890'}, 'phone', r'^\d{3}-\d{3}-\d{4}$') is None
  assert validate({'name': 'Jane'}, 'name', r'^\w+$') is None
output: def validate(data, field, pattern):
      import re
      if field in data:
          if not re.match(pattern, data[field]):
              raise ValueError(f"Field '{field}' does not match the pattern")