Skip to content
This repository was archived by the owner on Nov 13, 2019. It is now read-only.
This repository was archived by the owner on Nov 13, 2019. It is now read-only.

请问参数验证为什么不用正则表达式呢 #7

@Zhang-Siyang

Description

@Zhang-Siyang

比如 https://github.com/NUAA-Open-Source/NUAA-iCal-Python/blob/master/NUAAiCal/main.py#L84

if not (xq == '1' or xq == '2'):

1或2可以用'[12]'这样的正则表达式去匹配

同一文件 L68

if '-' in xn:

如果用'20/d{2}-20/d{2}'来匹配会省后边再次验证的代码

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions