Skip to content

Commit

Permalink
Refactor email extraction logic and improve filtering in findEmail fu…
Browse files Browse the repository at this point in the history
…nction
  • Loading branch information
ProgrammerNomad committed Aug 9, 2024
1 parent 8870763 commit 96df6fa
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,32 @@
Extract email address from any raw text data that contains email address
#Extract email address from any raw text data that contains email address


##Explanation:

###Get Input and Options:

input: Retrieves the text from the input textarea.
separator: Determines the separator based on user selection.
string: The string to filter emails by (if applicable).
groupBy: The number of emails to group together.
addressType: Whether to extract emails or URLs.
filterType: Whether to include or exclude emails based on string.
removeKeywords: An array of keywords to exclude from the results (if UseKeyword is checked).
Set Email Regex:

Selects the appropriate regular expression based on addressType and RemoveNumeric checkbox.
Extract and Filter:

rawEmails: Extracts potential emails/URLs using the regex.
uniqueEmails: Uses a Set to get unique emails efficiently.
filteredEmails: Filters emails based on filterType, string, and removeKeywords (if UseKeyword is checked).
Sort (Optional):

Sorts the filteredEmails alphabetically if the sort checkbox is checked.
Format Output:

Joins the filteredEmails with the chosen separator and groups them if groupBy is specified.
Display Results:

Updates the count input with the number of extracted emails.
Sets the output textarea's value to the formatted email string.

0 comments on commit 96df6fa

Please sign in to comment.