Regex for matching javadoc fragments

前端 未结 2 1233
春和景丽
春和景丽 2020-12-06 12:38

This question got me thinking in a regex for matching javadoc comments that include some specified text.

For example, finding all javad

相关标签:
2条回答
  • 2020-12-06 12:57

    Try this one :

    /\*\*([^\*]|\*(?!/))*?@deprecated.*?\*/
    
    0 讨论(0)
  • 2020-12-06 13:06

    method2() does not have a javadoc comment and is therefor not deprecated (though the comment states it should be).

    Also, if you want to extract information from the javadoc comments I’d recommend looking into the javadoc tool and writing a Doclet. You have easy access to all the information from the javadoc comment from there.

    0 讨论(0)
提交回复
热议问题