def remove_comment(str)
  str.gsub(%r!/\*(.+?)(\*/|$)!, "")
end

remove_comment('AAA')           # => "AAA"
remove_comment('AAA/*BBB*/')    # => "AAA"
remove_comment('AAA/*BBB')      # => "AAA"
remove_comment('AAA/*BBB*/CCC') # => "AAACCC"
remove_comment('AAA/*BBB/*CCC*/DDD*/EEE') # => "AAADDD*/EEE"
remove_comment('AAA/a//*BB*B**/CCC') # => "AAA/a/CCC"
