Building a Smart IDE: Identifying comments

  • + 0 comments

    One-Liner Solution: :P

    import re, sys
    
    print("\n".join(re.findall(r"//.*|/\*[\S\s]*?\*/", "\n".join([i.strip() for i in sys.stdin]))))