Number_Plate = input ("Number Plate of car :")
Validation = re.match("([a-zA-Z]{2}[0-9][Whitespace][A-Za-z]{3})",Number_Plate)
我的问题是如何为re.match
添加一个空白来检查?在Python中,如何将空白添加到RegEx模式?
Number_Plate = input ("Number Plate of car :")
Validation = re.match("([a-zA-Z]{2}[0-9][Whitespace][A-Za-z]{3})",Number_Plate)
我的问题是如何为re.match
添加一个空白来检查?在Python中,如何将空白添加到RegEx模式?
用'\ s'?你有没有考虑实际阅读正则表达式的语法? – jonrsharpe
这是一篇关于正则表达式中空格的好文章。你甚至可以尝试你自己的正则表达式(解决方案在页面底部)。考虑在询问特定模式之前习惯使用正则表达式。 –
关于RegEx(正则表达式)的更多信息[here](http://regexr.com)(请务必查看cheatsheet并使用测试仪) – x13