• 请不要在回答技术问题时复制粘贴 AI 生成的内容
norse15
V2EX  ›  程序员

请教大佬一个帝国 CMS 批量替换 的 正则表达式写法?

  •  
  •   norse15 · Aug 20, 2020 · 2270 views
    This topic created in 2092 days ago, the information mentioned may be changed or developed.

    请教大佬一个帝国 CMS 批量替换 的 正则表达式写法? 网站采集的内容 有些结尾有 猜你喜欢:xxxxxx 要用批量替换把 猜你喜欢和后面的内容全部替换掉,正则表达式应该怎么写? 我试过 猜你喜欢* 没用 猜你喜欢([\s\S]*) 没用

    6 replies    2020-08-21 12:33:58 +08:00
    huntzhan
        1
    huntzhan  
       Aug 20, 2020
    tnter
        2
    tnter  
       Aug 20, 2020
    采集的时候,把“猜你喜欢”作为截取结束的标识,不就好了吗
    norse15
        3
    norse15  
    OP
       Aug 20, 2020
    @tnter 采集发了才发现有些有这样的问题呀
    nandaye
        4
    nandaye  
       Aug 20, 2020
    猜你喜欢.*+
    norse15
        5
    norse15  
    OP
       Aug 20, 2020
    @nandaye 这个不得行,是在网站程序里用,你说的这个是其他的程序可以用吧
    ben1024
        6
    ben1024  
       Aug 21, 2020
    strstr($string,'猜你喜欢',true);
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3824 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 52ms · UTC 04:36 · PVG 12:36 · LAX 21:36 · JFK 00:36
    ♥ Do have faith in what you're doing.