input: from typing import List
  
  
  def has_matching_paren(s: str) -> bool:
      """ Check if a given string contains matching parentheses.
      >>> has_matching_paren("(a*b)")
      True
      >>> has_matching_paren(")a(b")
      False
      >>> has_matching_paren("((a+b)*c)")
      True
      >>> has_matching_paren(")(())(")
      False
      """
output:     stack = []
      for char in s:
          if char == '(':
              stack.append(char)
          elif char == ')':
              if not stack:
                  return False
              stack.pop()
      return len(stack) == 0