Is there any easy way to remove the comments from the text file in Java.
now:
:- /* #pos=1,513 */ author(A, UniqueVar1)
after:
author(A, UniqueVar1)
I used BufferedReader and readline to read and split the lines.
try this:
line.replaceAll("(?:/\\*(?:[^*]|(?:\\*+[^*/]))*\\*+/)|(?://.*)|(?::-)","");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With