我正在学习正则表达式,但无法在python中找到正确的正则表达式来选择以特定字母开头的字符。
下面的例子
text='this is a test'
match=re.findall('(?!t)\w*',text)
# match returns
['his', '', 'is', '', 'a', '', 'est', '']
match=re.findall('[^t]\w+',text)
# match
['his', ' is', ' a', ' test']
Run Code Online (Sandbox Code Playgroud)
预期: ['is','a']