{"id":91834,"date":"2022-02-10T11:01:00","date_gmt":"2022-02-10T11:01:00","guid":{"rendered":"https:\/\/academicwritersbay.com\/answers\/programming-on-regular-expressions\/"},"modified":"2022-02-10T11:01:00","modified_gmt":"2022-02-10T11:01:00","slug":"programming-on-regular-expressions","status":"publish","type":"post","link":"https:\/\/academicwritersbay.com\/answers\/programming-on-regular-expressions\/","title":{"rendered":"Programming on regular expressions."},"content":{"rendered":"<p>The Hedge of Protection Hospital, known as the HOP (cue fun music here), recently split itsAdmissions department into two sections: A \u2013 L and M \u2013 Z. Each department searches for datapertaining to its section and then processes it. For your section, A \u2013 L, use regexes to do thefollowing:<br \/>\nIn order to share the HOP newsletter and other specific information, read data from acopied input file and search it for email addresses in any standard format that beginwith A \u2013 L to identify your patients\u2019 primary contact email; ignore email addressesbeginning with M \u2013 Z.<br \/>\nSeparately, search for valid telephone numbers, including (xxx) xxx-xxxx and xxx-xxxxxxx.<br \/>\nTo get some general demographic information, search for patient birthdates (formatDD\/MM\/YYYY). Using the year only, select patients who were born prior to the year2000; ignore all other ages.Name your Python source code file HOP_Regex_YourName.py. Your program will need to:<br \/>\nCreate an output header welcoming the user.<br \/>\nCompile three regexes, one each for phone numbers, dates, and email addresses.o For the phone number, address phone formats xxx-xxx-xxxx and (xxx) xxx-xxxx.The phone regex from the book addresses more than you need. Do not use it;create one that addresses these formats only.o For the email address, address any standard format which ends with .org or.com; ignore all others. Remember to verify that they begin with letters A \u2013 Land to ignore all others.o For the dates, address date format DD\/MM\/YYYY only. Check that the dates arelegitimate by verifying that the month is between 1 and 12, inclusive, and thatthe days are between 1 and 31, inclusive; ignore all others.<br \/>\nUse pyperclip to copy data from the clipboard; then process the input against theregexes and other data verification. Remember to copy the data to the clipboard beforerunning your program \u2013 else your output will be empty. Consider placing each regex\u2019soutput into its own list.Use TheHOP_Admissions file provided as your data source (possibly called txt.rtf byD2L). Note: I may test the program against different source data.<br \/>\nSort each list.<br \/>\nPrint an informative header, additional helpful information, and each Admissions\u2019 list tothe screen<br \/>\nOther Article:<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Hedge of Protection Hospital, known as the HOP (cue fun music here), recently split itsAdmissions department into two sections: A \u2013 L and M&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-91834","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/posts\/91834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/comments?post=91834"}],"version-history":[{"count":0,"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/posts\/91834\/revisions"}],"wp:attachment":[{"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/media?parent=91834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/categories?post=91834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/academicwritersbay.com\/answers\/wp-json\/wp\/v2\/tags?post=91834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}