def _regexp_has_newline(r):
    """Expressions that may indicate newlines in a regexp:
        - newlines (
)
        - escaped newline (\\n)
        - anything but ([^...])
        - any-char (.) when the flag (?s) exists
    """
    return '\n' in r or '\\n' in r or '[^' in r or '(?s' in r and '.' in r
