'Check that the pattern does not begin with a forward slash.'

def _check_pattern_startswith_slash(self):

    regex_pattern = self.regex.pattern
    if (not settings.APPEND_SLASH):
        return []
    if ((regex_pattern.startswith('/') or regex_pattern.startswith('^/')) and (not regex_pattern.endswith('/'))):
        warning = Warning("Your    URL    pattern    {}    has    a    regex    beginning    with    a    '/'.    Remove    this    slash    as    it    is    unnecessary.    If    this    pattern    is    targeted    in    an    include(),    ensure    the    include()    pattern    has    a    trailing    '/'.".format(self.describe()), id='urls.W002')
        return [warning]
    else:
        return []
