<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_solid(regex):
 """ Check the given regular expression is solid. True True True True False False """


    shape = re.sub(r'(\\.|[^\[\]\(\)\|\?\+\*])', '#', regex)
    skeleton = shape.replace('#', '')
    if len(shape) <= 1:
        return True
    if re.match(r'^\[[^\]]*\][\*\+\?]?$', shape):
        return True
    if re.match(r'^\([^\(]*\)[\*\+\?]?$', shape):
        return True
    if re.match(r'^\(\)#*?\)\)', skeleton):
        return True
    else:
        return False