python - Properly mapping first names to emails? -


I am working on a research project and I have a list of ~ 200 names and 6 email addresses. It is necessary that every email from these email messages needs to be mapped to an email address after this requirement:

"Emails on names starting with A, B, C, D, E 1. F.G.G., H., I, J. Email 2 and so on and so forth.

Now I am trying to think about the name of a special mail to those names "If Name AE starts with email1 , due to all the names and the initial letter of each name Instead of checking the query. Is there a way to accomplish this? 'I can think that RegEx can help, but it is not certain that (possibly ^ [a-eA-E] ?)

again is an undocumented in the module that can be used to attach an arbitrary function call to redo the pattern. Could. This is called the Scanner.scan method, the supply text is matched with each regex pattern, and the associated function is said to be found when a match is found. Scan Me

  import re def make_email (i): def email (scanner, token): print ('{}}: send to e-mail {i}' format (t = token) , i = i)) email scanner = again. I, pat enumerate (("R" ^ [AE] \ w + "," R [^] [FJ] \ W + ")) # for Scanner ([[Pat, Make-Amel (I)) # 2 # 1 + [(R "\ s +", no)], flags = Puna.ananoarsiisi | again. Mtitiaii (scanner) ( "" "Albert Barry Carrie David Erin Franklin Geoff Harold Isadore J" "")  
 

Print

  Albert: Send to Email Barry: Send to Email 0 Carry: Send To Email David: Send To Email: Erin: Send Email Send Email0 Franklin To email Jeff Geoff: Send To Email 1 Harold: Send Email Send Email1: Jail: Send To Email 1   
  1. You can add more regex patterns here.
  2. The scanner class has been started with a list of 2-TUPLES. Each 2 -Tupal includes a regedx pattern and associated callback function.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -