我需要解析很多 yml 文件。我有类似示例的内容,在某些情况下存在一个值,因此我需要更改另一个规则的正则表达式。我找不到正确验证它的方法
yaml1:
email: someone@company.com
yaml2:
email: otherguy@home.com
contract_type: external
架构:
schema = {
'email': {
'required': True,
'type': 'string',
'regex': '^([a-zA-Z0-9_\-\.]+)@company\.com$'
}