找回密码
 立即注册
搜索
查看: 113|回复: 5

ceshi

[复制链接]

6

主题

5

回帖

90

积分

管理员

积分
90
发表于 2024-11-28 09:31:02 | 显示全部楼层 |阅读模式
ddd

  1. UPDATE pre_portal_article_content SET content=REPLACE(content,'</section>','');
复制代码
  1. 用正则表达式 在pre_portal_article_content表的 content字段中查找 <section style="*!important;">  其中*是通配符, url 是变量. 将这样的代码 删除
复制代码
  1. UPDATE pre_portal_article_content
  2. SET content = REGEXP_REPLACE(content, '<section style=".*?!important;">', '')
  3. WHERE content REGEXP '<section style=".*?!important;">';
复制代码


dd


6

主题

5

回帖

90

积分

管理员

积分
90
 楼主| 发表于 2024-11-28 09:59:58 | 显示全部楼层
  1. 用正则表达式 在pre_portal_article_content表的 content字段中查找  <img class="rich_pages wxw-img" * src=  其中*是通配符,将这段代码 替换为  <img src=
复制代码



  1. UPDATE pre_portal_article_content
  2. SET content = REGEXP_REPLACE(content, '<img class="rich_pages wxw-img" .*? src=', '<img src=')
  3. WHERE content REGEXP '<img class="rich_pages wxw-img" .*? src=';
复制代码


6

主题

5

回帖

90

积分

管理员

积分
90
 楼主| 发表于 2024-11-28 10:14:04 | 显示全部楼层
  1. 使用正则表达式在 pre_portal_article_content 表的 content 字段中查找并删除 <svg xmlns=*</svg> 形式的内容(其中 * 表示任意字符)
复制代码

  1. SELECT content
  2. FROM pre_portal_article_content
  3. WHERE content REGEXP '<svg xmlns=.*?</svg>';
复制代码

6

主题

5

回帖

90

积分

管理员

积分
90
 楼主| 发表于 2024-11-28 10:27:10 | 显示全部楼层
  1. 使用正则表达式在 pre_portal_article_content 表的 content 字段中查找 <p style="*;"> 并将其替换为  <p>
复制代码

  1. UPDATE pre_portal_article_content
  2. SET content = REGEXP_REPLACE(content, '<p style="[^"]*;">', '<p>')
  3. WHERE content REGEXP '<p style="[^"]*;">';
复制代码

6

主题

5

回帖

90

积分

管理员

积分
90
 楼主| 发表于 2024-11-28 12:36:38 | 显示全部楼层
  1. 使用正则表达式在 pre_portal_article_content 表的 content 字段中查找 <img data-* src="https 并将其替换为 <img src="https
复制代码

  1. UPDATE pre_portal_article_content
  2. SET content = REGEXP_REPLACE(content, '<img\\s*data-[^>]*src="https', '<img src="https')
  3. WHERE content REGEXP '<img\\s*data-[^>]*src="https';
复制代码

6

主题

5

回帖

90

积分

管理员

积分
90
 楼主| 发表于 2024-11-28 12:42:35 | 显示全部楼层
  1. 使用正则表达式在 pre_portal_article_content 表的 content 字段中查找  jpg" data-*;"> 并将其替换为 jpg" >
复制代码


  1. UPDATE pre_portal_article_content
  2. SET content = REGEXP_REPLACE(content, 'jpg" data-[^>]*?>', 'jpg" >')
  3. WHERE content REGEXP 'jpg" data-[^>]*?>';
复制代码
高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

Archiver|手机版|小黑屋|赣中网

GMT+8, 2025-5-1 14:30 , Processed in 0.095053 second(s), 22 queries .

Powered by Discuz! ganzhong

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表