I\'d like to do a function which gets a string and in case it has inline comments it removes it.
public class sample { public static void main(String[] arg
replaceAll("((/\\*)[^/]+(\\*/))|(//.*)", "")
This will remove single line, multi-line or doc comments.
The JavaScript compatible regex is ((/\*)[^/]+(\*/))|(//.*), which you can try with regexpal.com.
((/\*)[^/]+(\*/))|(//.*)