日期:2014-05-16  浏览次数:20424 次

正则表达式求帮忙
[[doku>wiki:dokuwiki|{{wiki:dokuwiki-128.png }}]] DokuWiki is a simple to use and highly versatile Open Source [[wp>wiki]] software that doesn't require a database. It is loved by users for its clean and readable [[wiki:syntax]]. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in [[doku>acl|access controls]] and [[doku>auth|authentication connectors]] make DokuWiki especially useful in the enterprise context and the large number of [[doku>plugins]] contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki.


去掉所有中括号和中括号里面的内容。
谢谢大家
------解决方案--------------------
var s = '...';
s = s.replace(/\[\[[^\]]*\]\]/g, '');

------解决方案--------------------
var str = "[[doku>wiki:dokuwiki
------解决方案--------------------
{{wiki:dokuwiki-128.png }}]] DokuWiki is a simple to use and highly versatile Open Source [[wp>wiki]] software that doesn't require a database. It is loved by users for its clean and readable [[wiki:syntax]]. The ease of maintenance, backup and integration makes it an administrator's favorite. Built in [[doku>acl
------解决方案--------------------
access controls]] and [[doku>auth
------解决方案--------------------
authentication connectors]] make DokuWiki especially useful in the enterprise context and the large number of [[doku>plugins]] contributed by its vibrant community allow for a broad range of use cases beyond a traditional wiki.";
   var strs = str.replace(/\[[^\]]*\]*/g,'');
    console.log(strs);