yeeling
V2EX  ›  问与答

PHP 正则匹配求解

  •  
  •   yeeling · Apr 5, 2016 · 2158 views
    This topic created in 3741 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   ·   1504 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 50ms · UTC 16:37 · PVG 00:37 · LAX 09:37 · JFK 12:37
    ♥ Do have faith in what you're doing.