使用php-pregmatch获取@something之后的文本


using php preg_match to get text after @something

我正在使用

if (preg_match('/@type's+([^'s]+)/', $refProp->getDocComment(), $matches)) {
    return $matches[1];
} else {
     return false;
}

读取类似的数据类型

/**
*@type INT
*/

在这里,我将得到"INT"字符串。

现在,我想进入洞的东西。类似:

/**
*@type INT NOT NULL DEFAUTL 1
*/

包括白色空间。我该怎么做?

提前谢谢!

使用以下表达式:

/@type's+(.+?)'s?$/m