Python 正则表达式查找相邻字符

来源:互联网 发布:炎锤网络 编辑:程序博客网 时间:2024/06/03 15:12

Regular Expression

# among word1 word2 word3, at most 5 words from each other\b(?:(?:word1()|word2()|word3()|(?:\1|\2|\3)\w+)\b\W*?){3,8}\1\2\3# among word1 word2 word3, any distance from each other^(?=[\s\S]*?\bword1\b)(?=[\s\S]*?\bword2\b)(?=[\s\S]*?\bword3\b)[\s\S]*


0 0