'Search for the DOM XSS vulns using smart grep (context regex).
:param response: The HTTP response object
:return: list of dom xss items'

def _smart_grep(self, response):

    res = []
    match = self._script_re.search(response.get_body())
    if (not match):
        return res
    for script_code in match.groups():
        for function_re in self.JS_FUNCTION_CALLS:
            parameters = function_re.search(script_code)
            if parameters:
                for user_controlled in self.DOM_USER_CONTROLLED:
                    if (user_controlled in parameters.groups()[0]):
                        res.append(user_controlled)
    return res
