无法使用正则表达式 (?<!)
代码
// 去除样式中top|right|bottom|left// 使用正则匹配// ASCII表 | \55 - | \72 : | \73 ; |
|
报错
当前解决方案
// 去除样式中top|right|bottom|left// 使用正则匹配// ASCII表 | \55 - | \72 : | \73 ; |let str = 'margin-top:12px;margin-bottom:12px;top:0;left:13px;';str.replace(/(\w+\55)?(top|right|bottom|left)\72\w+\73/g, function(res){ if (/(\w+\55)(top|right|bottom|left)/.test(res)) { return res } else { return '' }}) |
期望解决方案
只用一个正则表达式就能完成正则匹配
