bug fix: dkim permissions

This commit is contained in:
usmannasir
2023-09-24 17:44:30 +04:00
parent d87a8d8b99
commit 964141fcf2
5 changed files with 32 additions and 8 deletions

View File

@@ -0,0 +1,21 @@
import re
def extract_domain_parts(domain):
# Use a regular expression to extract the domain parts
pattern = r'(?:\w+\.)?(\w+)\.(\w+)'
match = re.match(pattern, domain)
if match:
subdomain = match.group(1)
top_level_domain = match.group(2)
return subdomain, top_level_domain
else:
return None, None
# Example usage
domain = "sub.example.ae"
subdomain, top_level_domain = extract_domain_parts(domain)
print("Subdomain:", subdomain)
print("Top-Level Domain:", top_level_domain)