gpt4 book ai didi

python - 使用正则表达式提取第一段

转载 作者:太空宇宙 更新时间:2023-11-04 06:26:13 24 4
gpt4 key购买 nike

我正在尝试提取第一段。但我找到了任何运气。谁能帮我?这是文字。 http://dpaste.com/638776/ .我的文字是动态的。谢谢

更新:我正在使用 eTree 模块读取 XML 文件。在 XML 中有一个名为 <text></text> 的标签. <text></text>之间的数据is here .我只想打印来自 text tags 的以下数据.是否可以?谢谢

  '''Zamindar''' ({{te|జమీందార్}}) is a 1965 [[Telugu language|Telugu]] "Thriller" film 
directed by [[V. Madhusudhan Rao]] and produced by [[Tammareddy Krishna Murthy]]
of Ravindra Art Pictures.This is variety role for [[Akkineni Nageswara Rao]]
who is more popular with soft Romantic roles.He plays the role of a tough CID Officer very well.The Movie has some Good songs.This movie has a considerable resemblance with the 1963 [[Cary Grant]] English Movie ''[[Charade (1963 film)|Charade]]''.

最佳答案

如果您在点与换行符匹配的地方构建了一个正则表达式,那么您已经(在 ruby​​ 中进行了测试,但我猜它会按原样在 python 中工作)。这与 Niall Byrne 的回答完全相同:

}}\n(.*?)\n\n

效果请看rubular .

关于python - 使用正则表达式提取第一段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7859816/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com