输入字符串Python的正则表达式查找字母和数字
我以前'findall'
地发现,只有字母和数字(被发现未指定的字数)字样。
我创建:
words = re.findall ("\ w * \ s", x) # x is the input string
如果我进入"asdf1234 cdef11dfe a = 1 b = 2"
这些句子分隔asdf1234, cdef11dfe, a =, 1, b =, 2
我想挑出只有asdf1234
,cdef11dfe
你怎么写一个正则表达式?
谢谢答复,但我需要更多帮助,如果我输入 “a01a b02 c03 e dfdfd abcdef = 2 b = 3 e = 4 c =”ab“aaa = 2f f =”asdf 12af“” 我只想选择a01a,b02,c03,e,dfdfd 我该如何创建正则表达式 –
结帐我更新的答案。 –
非常感谢! –