私はこれを持っています:
/**
* @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 \
そこに正規表現の第一人者がいることを願っています:-)