js 正则: 匹配不含有某段字符串的行

应用场景: 在显示日志时排除用于心跳的数据。
正则:

^((?!heartbeat).)*$

待匹配的文本:

{"type":"dialogue","data":{"uuid":"1672817549169","customerPhone":"1672817549169","agentPhone":"1011","content":"13点的吧\t","source":0,"date":"2023-01-04 15:32:49","engineStartTime":null,"beginTime":null,"endTime":null,"volumeAvg":null,"helperId":30,"id":48689,"occurTime":17}}
{"type":"heartbeat","data":{"ctimestamp":1672817568492}}

posted @ 2023-01-04 15:57  程序媛李李李李蕾  阅读(341)  评论(0编辑  收藏  举报