如何用Python语言实现在一个文件中查找特定的字符串

如题所述

用正则表达式
1234    >>> s='hello world'>>> import re>>> re.search('wor',s)<_sre.SRE_Match object; span=(6, 9), match='wor'>

温馨提示:答案为网友推荐,仅供参考
相似回答