美文网首页
正则表达式反选

正则表达式反选

作者: 折花载酒z | 来源:发表于2019-02-20 14:23 被阅读0次

示例:
<div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div>
<div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div>
<div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div><div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div><div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div><div style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></div>
<h1 style="-ms-layout-grid: both loose 15.6pt none; text-align: center;"></h1>
需要匹配出来h1标签
ps:在实际开发中使用h1直接匹配太繁琐
so:
使用?!进行反选
<(?!div).?text-align: center.?/(?!div).*?>

相关文章

网友评论

      本文标题:正则表达式反选

      本文链接:https://www.haomeiwen.com/subject/wikhyqtx.html