import re


def is_valid_date(string):
    """Return True iff the string represents a valid YYYY-MM-DD date."""

    val = bool(re.search(r'^\d{4}\-(0\d|1[0-2])\-(0\d|[12]\d|3[01])$', string))
    return val