I have a string for e.g.
String src = "How are things today /* this is comment *\*/ and is your code /*\* this is another comment */ working?"
I want to remove /* this is comment *\*/ and /** this is another comment */ substrings from the src string.
I tried to use regex but failed due to less experience.
Try using this regex (Single line comments only):
REGEX explained:
Alternatively here is regex for single and multi-line comments by adding (?s):
Reference: