added re.S to regex call