我想使用regex在Igbo文本中提取wor'word
形式的单词(我对regex真的不太了解)。例如
line = "jir’ọbara ya"
如果我这样做了
found = re.match("\w+’\w+", line)
print found.group()
我得到的是'NoneType' object has no attribute 'group'
,而不是jir’ọbara
然后,如果我做found = re.match("\w+’|\w+", line)
,它只给我jir’
。你知道吗
关于如何解决这个问题或最好的其他方法有什么建议吗?谢谢。你知道吗
如果行的格式一致,则:
或者
相关问题 更多 >
编程相关推荐