lookahead and non-capturing regular expressions
问题 I'm trying to match the local part of an email address before the @ character with: LOCAL_RE_NOTQUOTED = """ (( \w # alphanumeric and _ | [!#$%&'*+-/=?^_`{|}~] # special chars, but no dot at beginning ) ( \w # alphanumeric and _ | [!#$%&'*+-/=?^_`{|}~] # special characters | ([.](?![.])) # negative lookahead to avoid pairs of dots. )*) (?<!\.)(?:@) # no end with dot before @ """ Testing with: re.match(LOCAL_RE_NOTQUOTED, "a.a..a@", re.VERBOSE).group() gives: 'a.a..a@' Why is the @ printed in