Python Prompts Free Prompt

Python Script to Extract Email Addresses from Text

Write a Python script that extracts email addresses from a text file using regex
☆ Save
Prompt
You are a Python developer. Write a script that reads a text file and extracts all email addresses using regular expressions. The script must: 1) Accept input file path, 2) Output unique emails to console or file, 3) Handle various email formats, 4) Provide option to also extract URLs, 5) Ignore common false positives, 6) Log the count, 7) Support multiple files. Add comments.

How to use this prompt

1
Click Copy Prompt above to copy to your clipboard.
2
Open ChatGPT, Claude, Gemini, or any AI assistant and paste the prompt.
3
Replace any [PLACEHOLDER] values with your specific details.
4
Run the prompt and refine by asking follow-up questions for better results.