Skip to content

Commit

Permalink
bugdown: Rename variables regex to REGEX for importing regex module.
Browse files Browse the repository at this point in the history
  • Loading branch information
aero31aero authored and timabbott committed Jan 28, 2019
1 parent 3b7d899 commit 9f2c52c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions zerver/lib/bugdown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ def get_web_link_regex() -> str:
nested_paren_chunk = nested_paren_chunk % (inner_paren_contents,)

file_links = r"| (?:file://(/[^/ ]*)+/?)" if settings.ENABLE_FILE_LINKS else r""
regex = r"""
REGEX = r"""
(?<![^\s'"\(,:<]) # Start after whitespace or specified chars
# (Double-negative lookbehind to allow start-of-string)
(?P<url> # Main group
Expand All @@ -169,7 +169,7 @@ def get_web_link_regex() -> str:
(?:\Z|\s) # followed by whitespace or end of string
)
""" % (tlds, nested_paren_chunk, file_links)
LINK_REGEX = verbose_compile(regex)
LINK_REGEX = verbose_compile(REGEX)
return LINK_REGEX

def clear_state_for_testing() -> None:
Expand Down Expand Up @@ -1048,8 +1048,8 @@ def handleMatch(self, match: Match[str]) -> Optional[Element]:

def possible_avatar_emails(content: str) -> Set[str]:
emails = set()
for regex in [AVATAR_REGEX, GRAVATAR_REGEX]:
matches = re.findall(regex, content)
for REGEX in [AVATAR_REGEX, GRAVATAR_REGEX]:
matches = re.findall(REGEX, content)
for email in matches:
if email:
emails.add(email)
Expand Down

0 comments on commit 9f2c52c

Please sign in to comment.