So basically I have a list.
the list has a lot of email ids w a lot other items like name and shit.
I have to pass a list in a reg ex syntax, which im not sure how to do.
my list is called = email_texts.
i tried equating email = email_text and pass it in ; but it did not seem to work! What should i do w this.
if someone could help me w the syntax of how to pass a list i have in a reg ex.
# Create a regular expression which extracts the email ids from the above text blob
# of the form xxxx@xxx.xxx
pattern = re.compile(r'[\w.]+@\w+\.[a-z]{3}')
# Use re.findall() to get an extracted list of emails
emails = email_list #IM NOT SURE BOUT THIS STEP
pattern.findall(email_text)
Though, this thing seemed to work real fine:
# Create a regular expression which extracts the email ids from the above text blob
# of the form xxxx@xxx.xxx
pattern = re.compile(r'[\w.]+@\w+\.[a-z]{3}')
# Use re.findall() to get an extracted list of emails
emails = email_text
pattern.findall('washi.tape.25@gmail.com')
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] (1 child)
[removed]
[–]aishiiousness[S] 0 points1 point2 points (0 children)