これは正規表現愛好家のためのものです:)
FLOW3 のコード規則では、何も返さないメソッドには @return void で注釈を付ける必要があると主張しています。
/**
* A method
*
* @return void
*/
私はそれを忘れ続け、見逃したすべてのメソッドをネットビーンズで正規表現したい...
これまでのところ私は得た
\*\s[^@return]+.*(\n)\s.\*/
これは本当にうまくいきません:
/**
* Method that gets matched.
*
* @param string $comment
*/
public function aMethod() {
// Some Code
}
/**
* A method that does not get matched and shouldn't.
*
* @param string $test
* @return void
*/
public function anotherMethod($test) {
// Some Code
}
/**
* A variable that get's matched but should not
* be matched.
*
* @var string
*/
protected $var;
/**
* Why is this method getting matched?
*
* @return void
*/
private function thirdMethod() {
// Code
}
これをどのように一致させますか?
正規表現テスターの例を次に示します。