really be dot-anything this is between two and four characters the format for email addresses has lot of weird rules this regular expression won' match every possible valid email addressbut it'll match almost any typical email address you'll encounter step find all matches in the clipboard text now that you have specified the regular expressions for phone numbers and email addressesyou can let python' re module do the hard work of finding all the matches on the clipboard the pyperclip paste(function will get string value of the text on the clipboardand the findall(regex method will return list of tuples make your program look like the following#python phoneandemail py finds phone numbers and email addresses on the clipboard import pyperclipre phoneregex re compile( '''--snip-find matches in clipboard text text str(pyperclip paste()matches [for groups in phoneregex findall(text)phonenum '-join([groups[ ]groups[ ]groups[ ]]if groups[ !''phonenum +xgroups[ matches append(phonenumfor groups in emailregex findall(text)matches append(groups[ ]todocopy results to the clipboard there is one tuple for each matchand each tuple contains strings for each group in the regular expression remember that group matches the entire regular expressionso the group at index of the tuple is the one you are interested in as you can see at you'll store the matches in list variable named matches it starts off as an empty listand couple for loops for the email addressesyou append group of each match for the matched phone numbersyou don' want to just append group while the program detects phone numbers in several formatsyou want the phone number appended to be in singlestandard format the phonenum variable contains string built from groups and of the matched text (these groups are the area codefirst three digitslast four digitsand extension