mirror of
https://github.com/cnlimiter/codex-register.git
synced 2026-06-08 00:50:05 +08:00
Merge pull request #10 from Senkoi/fix-re
fix: avoid matching 6-digit numbers inside email addresses
This commit is contained in:
@@ -326,8 +326,9 @@ class CustomDomainEmailService(BaseEmailService):
|
|||||||
if "openai" not in sender and "openai" not in content.lower():
|
if "openai" not in sender and "openai" not in content.lower():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# 提取验证码
|
# 提取验证码 过滤掉邮箱
|
||||||
match = re.search(pattern, content)
|
email_pattern = r"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
|
||||||
|
match = re.search(pattern, re.sub(email_pattern, "", content))
|
||||||
if match:
|
if match:
|
||||||
code = match.group(1)
|
code = match.group(1)
|
||||||
logger.info(f"从自定义域名邮箱 {email} 找到验证码: {code}")
|
logger.info(f"从自定义域名邮箱 {email} 找到验证码: {code}")
|
||||||
|
|||||||
Reference in New Issue
Block a user