import re
import pyperclip

# Create a regex for phone numbers
# Using American Phone Numbers - 123-345-6060 or (123) 345-6060 or 345-6060
phoneRegex = re.compile(r"""
   ( ((\d\d\d) | (\(\d\d\d\)) )?     #area code
    (\s | -)                     # Secanrio 2 or there is a -
    \d\d\d                      #triple digits
    -
    \d\d\d\d   )                 #ending digits
""", re.VERBOSE)

# Create a regex for email addresses
# something.+_@something.whatever
emailRegex = re.compile(r"""
    [a-zA-Z0-9.+_]+
    @
    [a-z0-9.+_]+
""", re.VERBOSE)

# Get the text off the clipboard
txt = pyperclip.paste()

# Extract the email/phone from the text
phone = phoneRegex.findall(txt)
email = emailRegex.findall(txt)


for phones in range(len(phone)):
    phone[phones] = phone[phones][0]

#  Copy the extracted emai/phone to clipboard
print(phone)
print(email)

9efe1370ef153da04485a82933bfdd89344e8189
<mask token>

<mask token>
for phones in range(len(phone)):
    phone[phones] = phone[phones][0]
print(phone)
print(email)

<mask token>
phoneRegex = re.compile(
    """
   ( ((\\d\\d\\d) | (\\(\\d\\d\\d\\)) )?     #area code
    (\\s | -)                     # Secanrio 2 or there is a -
    \\d\\d\\d                      #triple digits
    -
    \\d\\d\\d\\d   )                 #ending digits
"""
    , re.VERBOSE)
emailRegex = re.compile("""
    [a-zA-Z0-9.+_]+
    @
    [a-z0-9.+_]+
""",
    re.VERBOSE)
txt = pyperclip.paste()
phone = phoneRegex.findall(txt)
email = emailRegex.findall(txt)
for phones in range(len(phone)):
    phone[phones] = phone[phones][0]
print(phone)
print(email)

import re
import pyperclip
phoneRegex = re.compile(
    """
   ( ((\\d\\d\\d) | (\\(\\d\\d\\d\\)) )?     #area code
    (\\s | -)                     # Secanrio 2 or there is a -
    \\d\\d\\d                      #triple digits
    -
    \\d\\d\\d\\d   )                 #ending digits
"""
    , re.VERBOSE)
emailRegex = re.compile("""
    [a-zA-Z0-9.+_]+
    @
    [a-z0-9.+_]+
""",
    re.VERBOSE)
txt = pyperclip.paste()
phone = phoneRegex.findall(txt)
email = emailRegex.findall(txt)
for phones in range(len(phone)):
    phone[phones] = phone[phones][0]
print(phone)
print(email)

import re
import pyperclip

# Create a regex for phone numbers
# Using American Phone Numbers - 123-345-6060 or (123) 345-6060 or 345-6060
phoneRegex = re.compile(r"""
   ( ((\d\d\d) | (\(\d\d\d\)) )?     #area code
    (\s | -)                     # Secanrio 2 or there is a -
    \d\d\d                      #triple digits
    -
    \d\d\d\d   )                 #ending digits
""", re.VERBOSE)

# Create a regex for email addresses
# something.+_@something.whatever
emailRegex = re.compile(r"""
    [a-zA-Z0-9.+_]+
    @
    [a-z0-9.+_]+
""", re.VERBOSE)

# Get the text off the clipboard
txt = pyperclip.paste()

# Extract the email/phone from the text
phone = phoneRegex.findall(txt)
email = emailRegex.findall(txt)


for phones in range(len(phone)):
    phone[phones] = phone[phones][0]

#  Copy the extracted emai/phone to clipboard
print(phone)
print(email)
