我有一个文本段落my_text
,其中包含如下行
........ licensed in Bangladesh. We are happy to announce ......................
................................................
我想从中提取“孟加拉国”这个词。要决定我是否想要那个词,取决于句子中是否有“licensed in”。你知道吗
当前代码如下:
texts = my_text.split("licensed in")
# extract the word before the first dot (.) from texts[1]
在python中,哪种方法更合适?你知道吗
这是正则表达式的工作:
说明:
怎么样
相关问题 更多 >
编程相关推荐