正则表达式API文档注释

时间:2012-06-06 21:15:20

标签: regex

注释的正则表达式是这样的:

/**
 * -string- (possible line) 
-possibly more lines like the above one-
 */

例如:

/**
 * The Boring class implements this and that
 * and also...
 * does this and that
 */

1 个答案:

答案 0 :(得分:5)

带有dotall(点匹配所有)标志的简单/\*\*.*?\*/应该可以解决问题。虽然它可能需要不同的转义或可能的分隔符,具体取决于您正在使用的正则表达式引擎的风格。

如果您的引擎中没有dotall,请尝试以下方法:

/\*\*[\s\S]*?\*/