yeeling
V2EX  ›  问与答

PHP 正则匹配求解

  •  
  •   yeeling · Apr 5, 2016 · 2183 views
    This topic created in 3759 days ago, the information mentioned may be changed or developed.

    {DOO}任意 ASCII 字符{DOO}任意 ASCII 字符{DOOEND}任意 ASCII 字符{DOOEND} Example: {DOO}dog{DOO}cat{DOOEND}apple{DOOEND}

    如何匹配获取{DOO}{DOOEND}标签中没有{DOO}{DOOEND}标签的内容 cat 。 标签{DOO}和{DOOEND}可能多层嵌套。

    1 replies    2016-05-07 20:42:15 +08:00
    yeeling
        1
    yeeling  
    OP
       May 7, 2016
    已解决:"/\{DOO\}([^{]+?)\{DOOEND\}/";
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3407 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 12:07 · PVG 20:07 · LAX 05:07 · JFK 08:07
    ♥ Do have faith in what you're doing.