dongyun6003 2011-06-08 13:10
浏览 17
已采纳

一个正则表达式的问题

I have the following string in PHP:

<p> [#form id=1]</p>

What is the pattern for getting it? I tried this:

/\<p\>\s\[\#.+?.\]\s\<\/p\>/

But it does not work. Any idea?

  • 写回答

3条回答 默认 最新

  • dongtou2016 2011-06-08 13:13
    关注
    /\<p\>\s*\[\#.+?.\]\s*\<\/p\>/
    

    You don't have space after ] , but regexp test for it

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?