Python 查找含有特定单个或多个字符的行

来源:互联网 发布:淘宝开店分享心得 编辑:程序博客网 时间:2024/06/03 21:06
1. Match Complete Lines That contain a Word (eg. error)(?im)^.*\berror\b.*$2. Match any lines That contain one of multiple words (eg, one, two , three)(?im)^.*\b(one|two|three)\b.*$3. Match lines that must contain multiple words(?im)^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).+$

0 0
原创粉丝点击