Java - regular expression finding comments in code

后端 未结 5 1129
感动是毒
感动是毒 2020-11-27 18:45

A little fun with Java this time. I want to write a program that reads a code from standard input (line by line, for example), like:

// some         


        
5条回答
  •  半阙折子戏
    2020-11-27 19:05

    Another alternative is to use some library supporting AST parsing, for e.g. org.eclipse.jdt.core has all the APIs you need to do this and more. But then that's just one alternative:)

提交回复
热议问题