import re


def strip_verilog_comments(line, begin_char):
  """ strip comments denoted by the character, begin_char """
  for mobj in re.finditer(begin_char+r".*$|'[^']*'"+r'|"[^"]*"', line):
    sp = mobj.span()
    if line[sp[0]] not in ["'", '"']:
      line = line[:sp[0]] + line[sp[1]:]
  return line