'Returns True if this snippet matches \'before\'.'

def matches(self, before, visual_content=None):

    self._matched = ''
    words = _words_for_line(self._trigger, before)
    if ('r' in self._opts):
        try:
            match = self._re_match(before)
        except Exception as e:
            self._make_debug_exception(e)
            raise
    elif ('w' in self._opts):
        words_len = len(self._trigger)
        words_prefix = words[:(- words_len)]
        words_suffix = words[(- words_len):]
        match = (words_suffix == self._trigger)
        if (match and words_prefix):
            boundary_chars = escape((words_prefix[(-1):] + words_suffix[:1]), '\\"')
            match = (_vim.eval(('"%s"    =~#    "\\\\v.<."' % boundary_chars)) != '0')
    elif ('i' in self._opts):
        match = words.endswith(self._trigger)
    else:
        match = (words == self._trigger)
    if (match and (not self._matched)):
        self._matched = self._trigger
    if (('b' in self._opts) and match):
        text_before = before.rstrip()[:(- len(self._matched))]
        if (text_before.strip('     DCTB ') != ''):
            self._matched = ''
            return False
    self._context = None
    if (match and self._context_code):
        self._context = self._context_match(visual_content)
        if (not self.context):
            match = False
    return match
