我有这个:
/**
* @file
* API for loading and interacting with modules.
* More explaination here.
*
* @author Reveller <me@localhost>
* @version 19:05 28-12-2008
*/
我正在寻找一个正则表达式来去除除@token 数据之外的所有数据,因此结果将是:
@file API for loading and interacting with modules. More explaination here.
@author Reveller <me@localhost>
@version 19:05 28-12-2008
我现在有这个:
$text = preg_replace('/\r?\n *\* */', ' ', $text);
它部分完成了这项工作:它只删除了每行前面的 *。谁能帮我,所以它也去掉 /** 和最后的斜线 /?任何帮助将不胜感激!
PS:例如,如果 commentlbock 将包含类似
/**
* @foo Here's some slashes for ya: / and \
*/
那么显然@foo 之后的斜线可能不会被剥离。结果必须是:
@foo Here's some slashes for ya: / and \
我希望那里有一个正则表达式大师:-)