Skip to content

Commit 96df6fa

Browse files
Refactor email extraction logic and improve filtering in findEmail function
1 parent 8870763 commit 96df6fa

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,32 @@
1-
Extract email address from any raw text data that contains email address
1+
#Extract email address from any raw text data that contains email address
2+
3+
4+
##Explanation:
5+
6+
###Get Input and Options:
7+
8+
input: Retrieves the text from the input textarea.
9+
separator: Determines the separator based on user selection.
10+
string: The string to filter emails by (if applicable).
11+
groupBy: The number of emails to group together.
12+
addressType: Whether to extract emails or URLs.
13+
filterType: Whether to include or exclude emails based on string.
14+
removeKeywords: An array of keywords to exclude from the results (if UseKeyword is checked).
15+
Set Email Regex:
16+
17+
Selects the appropriate regular expression based on addressType and RemoveNumeric checkbox.
18+
Extract and Filter:
19+
20+
rawEmails: Extracts potential emails/URLs using the regex.
21+
uniqueEmails: Uses a Set to get unique emails efficiently.
22+
filteredEmails: Filters emails based on filterType, string, and removeKeywords (if UseKeyword is checked).
23+
Sort (Optional):
24+
25+
Sorts the filteredEmails alphabetically if the sort checkbox is checked.
26+
Format Output:
27+
28+
Joins the filteredEmails with the chosen separator and groups them if groupBy is specified.
29+
Display Results:
30+
31+
Updates the count input with the number of extracted emails.
32+
Sets the output textarea's value to the formatted email string.

0 commit comments

Comments
 (0)