我正在尝试开发一个正则表达式来匹配只包含字母、数字、空格和点(.)的字符串,而且这些字符可以随意排列。
例如:
hello223 3423. ---> True
lalala.32 --->True
.hellohow1 ---> True
0you and me = ---> False (it contains =)
@newye ---> False (it contains @)
With, the name of the s0ng .---> False (it start with ,)
我正在尝试使用这个,但它总是返回匹配结果:
m = re.match(r'[a-zA-Z0-9,. ]+', word)
有什么想法吗?
另外一个表述问题的方式是,除了字母、数字、点和空格之外,还有没有其他不同的字符?
提前致谢。