yeeling
V2EX  ›  问与答

PHP 正则匹配求解

  •  
  •   yeeling · Apr 5, 2016 · 2118 views
    This topic created in 3718 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   ·   3564 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 00:41 · PVG 08:41 · LAX 17:41 · JFK 20:41
    ♥ Do have faith in what you're doing.