Question: In this project, you will create a script that uses regular expressions to validate that an e-mail address is valid for delivery to a user

In this project, you will create a script that uses regular expressions to validate that an e-mail address is valid for delivery to a user at example.org. For an e-mail address to be in the correct format, only username or first.last may appear before the @ symbol, and only example.org or mail.example.org may appear after the @ symbol.

You will be evaluated on the basis of all coding conventions including adding comments before every functions and author/param.

1. Create a new document in your text editor. 2. Type the declaration, element, document head, and element. Use the strict DTD and Validate Local Address as the content of the element. 3. Add the following text and elements to the document body: <h1>Validate Local Address</h1><hr /> 4. Add the following script section to the document body: <?php ?> 5. In the script section, declare an $email array that contains five e-mail addresses: $email = array( "jsmith123@example.org", "john.smith.mail@example.org", "john.smith@example.org", "john.smith@example", "jsmith123@mail.example.org"); 6. Add the following statements to iterate through each of the elements in the $email array to determine if it is in the correct format: foreach ($email as $emailAddress){ echo "The email address “" . $emailAddress . "” "; if (preg_match("/^(([A-Za-z]+\d+)|" . "([A-Za-z]+\.[A-Za-z]+))" . "@((mail\.)?)example\.org$/i", $emailAddress)==1) echo " is a valid e-mail address."; else echo " is not a valid e-mail address."; } 7. Save the document as ValidateLocalAddress.php in the Projects directory for Chapter 3 and upload the file to the server. 8. Open ValidateLocalAddress.php in your Web browser by entering the following URL: http://<yourserver>/PHP_Projects/Chapter.03/Projects/ ValidateLocalAddress.php. Test the script to see if it specifies which e-mail addresses are valid and which are not. The sec- ond and fourth e-mail addresses should be invalid. 9. Close your Web browser window. </p> </div> <div class="question-answer-divider"></div> <section class="answerHolder" itemscope itemtype="http://schema.org/Answer"> <div class="answerHolderHeader"> <h2>Step by Step Solution</h2> <div class="answerReviews"> <div class="starIcon"> </div> </div> </div> <div class="questionProperties"> <p>There are 3 Steps involved in it</p> <div class="cart-flex"> <div class="cart cart1"> 1 Expert Approved Answer </div> </div> </div> <div class="step org_answer"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="step-heading step-1">Step: 1 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> <img src="https://www.solutioninn.com/includes/images/document_product_info/blur-text-image.webp" class="blured-ans-image" width="759" height="271" alt="blur-text-image" decoding="async" fetchpriority="high"> <div class="step1Popup"> <span class="heading">Question Has Been Solved by an Expert!</span> <p>Get step-by-step solutions from verified subject matter experts</p> <button class="view_solution_btn step1PopupButton">View Solution</button> </div> </div> <div class="step"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="accordion step-heading">Step: 2 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> </div> <div class="step"> <span class="view_solution_btn view-solution-btn-cursor"> <strong class="accordion step-heading">Step: 3 <span>Unlock <i class="fa-solid fa-lock"></i></span></strong> </span> </div> </section> <section class="relatedQuestion"> <h3>Students Have Also Explored These Related Databases Questions!</h3> <div class="relatedQuestionSliderHolder"> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/instructions-1-create-an-empty-folder-in-the-root-directory-9993105" > Instructions (1) Create an empty folder in the root directory [c: wamp64 wwwand name it as YourFirstName_IDNumber_SetE" (Eg. Muncer_16J123_SetE). This will be your web application project folder 2)... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/complete-required-steps-write-3-php-functions-that-takes-12641749" > Complete required steps: - Write 3 PHP functions that takes input and returns true if the input is valid, and false otherwise, these functions should use regular expressions to validate user input. -... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/sample-output-yahya-gilany-email-yahyagilanyucedu-13858907" > SAMPLE OUTPUT: ``` **************************************************** Yahya Gilany **************************************************** email: Yahya.Gilany@uc.edu ** Personal Background:... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/here-all-the-questions-i-need-only-php-exercise-33-12367045" > here all the questions I need only PHP Exercise 3-3 PHP Exercise 3-1 In this exercise, you will create a script that validates whether a credit card number contains only integers. The script will... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/create-a-script-called-validateemailphp-that-uses-regular-expressions-to-9679682" > Create a script called ValidateEmail.php that uses regular expressions to validate that an e-mail address is valid for delivery to a user at example.org . For an e-mail to be in the correct format,... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/using-the-case-study-below-memo-to-the-project-sponsor-17808656" > Using the case study below: Memo to the Project Sponsor. In the memo, outline the following: a. Recommendations for managing the project - should leverage the scope management plan and scope... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/using-the-case-study-below-analyse-the-project-from-your-18223959" > Using the case study below: Analyse the project from your own perspective as an up-and-coming project manager Devise a Schedule Project Management Plan and Cost Project Management Plan based on the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/using-the-case-study-below-analyse-the-project-from-your-27550632" > Using the case study below: Analyse the project from your own perspective as an up-and-coming project manager Devise a set of subsidiary Project Management plans for Schedule and Cost based on the... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/m5-dynamic-content-take-2-please-note-you-may-find-12714521" > M5 Dynamic Content (Take 2) PLEASE NOTE: You may find that the "Processing Forms" section of Chapter 7 of Programming PHP (assigned in this module's readings) is critical for this assignment. You... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/write-the-program-in-java-demonstrate-that-you-understand-how-576773" > write the program in java. Demonstrate that you understand how to use object-oriented programming concepts, display data from a table in a database, obtain input from the user, validate user input,... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/a-let-w-13i-express-1w-and-1w-in-422922" > (a) Let w = 1+3i. Express 1/w and 1/w in the form of a + iy. (b) Consider the equation 26 +225 -9 24 +60 2 +65 2-126 z - 13 = 0 (i) State the number of roots and explain your reasoning. (ii) Given... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/04534-all-el-two-cable-tensions-and-a-couple-act-240300" > Two cable tensions and a couple act on the rod OAB. Determine the component of the equivalent couple at O around X. Given that F1 =4 KN; F2 = 6 KN and M = 7 KN.m 3 m -3 m 3 m F1 F2 4 m 2 m Mx = 15.23... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/given-the-following-table-of-data-table-name-vehicles-license-27861522" > Given the following table of data: Table name: Vehicles License Owner Make Model Year Value Cylinders ABC 3 3 3 J . Jones Volvo 2 4 0 1 9 9 3 2 3 0 0 4 BGF 6 7 8 A . Ames Ford Tarus 2 0 1 0 1 3 0 0 0... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/questions/which-of-the-following-are-problems-with-identifying-users-of-18361598" > Which of the following are problems with identifying users of ABC? Multiple select question. ABC means different things to different organizations. Organizations will announce the discontinuance of... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/management-information-systems/412-in-mymislab-you-will-find-a-collaboration-and-teamwork-2117030" > 4-12 In MyMISLab, you will find a Collaboration and Teamwork Project dealing with the concepts in this chapter. You will be able to use Google Drive, Google Docs, Google Sites, Google+, or other open... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/management-information-systems/410-in-this-project-you-will-learn-how-to-build-2117028" > 4-10 In this project, you will learn how to build a simple blog. Using the blog creation software at Blogger.com, follow the instructions to create a blog. Give your blog a suitable name; choose a... </a> </div> <div class="relatedQuestionCart "> <p class="heading">Q: </p> <a class="relatedQuestionText" href="/study-help/management-information-systems/413-perform-an-ethical-analysis-of-facebook-what-is-the-2117031" > 4-13 Perform an ethical analysis of Facebook. What is the ethical dilemma presented by this case? Over the course of less than a decade, Facebook has morphed from a small, niche networking site for... </a> </div> </div> <nav class="navigationButtons"> <a class="previousQuestionButton" href="/study-help/questions/in-c-you-have-a-class-student-with-two-members-10380263">Previous Question</a> <a class="nextQuestionButton" href="/study-help/questions/ssae-1-developer-3-8-1-5-4-2-10380265">Next Question</a> </nav> </section> </main> <aside class="expertRight"> <section class="relatedBook" style="margin-bottom:40px; width: 100%;" > <div class="bookHolder" > <div class="relatedBookHeading" > <h2 class="heading">Recommended Textbook</h2> </div> <div class="bookMainInfo" > <div class="bookImage" style="width: 100px !important; min-width: 100px; flex-shrink: 0; margin-right: 20px;"> <a href="/textbooks/sql-for-data-science-data-cleaning-wrangling-and-analytics-with-relational-databases-1st-edition-978-3030575915-175741"> <img src="https://dsd5zvtm8ll6.cloudfront.net/si.question.images/book_images/2024/01/6597bd4e486df_2146597bd4e432e7.jpg" width="100" height="131" alt="SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases" loading="lazy" style="width: 100px !important;"> </a> </div> <div class="bookInfo" style="text-align: left;"> <span class="bookTitle" style="text-align: left;"> <a href="/textbooks/sql-for-data-science-data-cleaning-wrangling-and-analytics-with-relational-databases-1st-edition-978-3030575915-175741" style="text-align: left;"> SQL For Data Science Data Cleaning Wrangling And Analytics With Relational Databases </a> </span> <div class="bookMetaInfo" style="text-align: left;"> <p class="bookAuthor" style="text-align: left;"> <b>Authors:</b> <span>Antonio Badia</span> </p> <p class="bookEdition" style="text-align: left;"> 1st Edition </p> <p class="bookEdition" style="text-align: left;"> 3030575918, 978-3030575915 </p> </div></div></div> </div> </section> <div class="post-question-section"> <div class="description-question-section"> <span class="post-question-section-title">Ask a Question and Get Instant Help!</span> </div> <div class="text-area-post-question"> <form action="/study-help/post-question?ref=search" method="post" enctype="multipart/form-data"> <textarea rows="4" class="form-control form-posting-margin" name="textarea-question-content" id="textarea-question-content" placeholder="Type Your Question ...."></textarea> <button type="submit" class="btn btn-sm btn-submit-post-question text-center">Get Answer</button> </form> </div> </div> </aside> </div> </div> <div class="promo items-center justify-center hidden"> <div class="app_promo"> <span class="app_promo_dismiss"> <i class="fa-solid fa-x"></i> </span> <div class="app-button"> <div class="image-wrapper"> <img width="30" height="30" src="https://www.solutioninn.com/includes/images/rewamp/common/mobile-app-logo.png" decoding="async" fetchpriority="high" alt="SolutionInn App Logo"> <strong>Study Help</strong> </div> <button class="app_promo_action redirection" data-question-open-url='q_id=10380264&q_type=2'> Open in App </button> </div> </div> </div> </div> </div> <div class="blank-portion"></div> <footer> <div class="container footerHolder"> <div class="footerLinksFlex"> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Services</p> <ul> <li><a href="/site-map">Sitemap</a></li> <li><a href="/fun/">Fun</a></li> <li><a href="/study-help/definitions">Definitions</a></li> <li><a href="/tutors/become-a-tutor">Become Tutor</a></li> <li><a href="/books/used-textbooks">Used Textbooks</a></li> <li><a href="/study-help/categories">Study Help Categories</a></li> <li><a href="/study-help/latest-questions">Recent Questions</a></li> <li><a href="/study-help/questions-and-answers">Expert Questions</a></li> <li><a href="/clothing">Campus Wear</a></li> <li><a href="/sell-books">Sell Your Books</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Company Info</p> <ul> <li><a href="/security">Security</a></li> <li><a href="/copyrights">Copyrights</a></li> <li><a href="/privacy">Privacy Policy</a></li> <li><a href="/conditions">Terms & Conditions</a></li> <li><a href="/solutioninn-fee">SolutionInn Fee</a></li> <li><a href="/scholarships">Scholarship</a></li> <li><a href="/online-quiz">Online Quiz</a></li> <li><a href="/study-feedback">Give Feedback, Get Rewards</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-6"> <p>Get In Touch</p> <ul> <li><a href="/about-us">About Us</a></li> <li><a href="/support">Contact Us</a></li> <li><a href="/career">Career</a></li> <li><a href="/jobs">Jobs</a></li> <li><a href="/support">FAQ</a></li> <li><a href="https://www.studentbeans.com/en-us/us/beansid-connect/hosted/solutioninn" target="_blank" rel="noopener nofollow">Student Discount</a></li> <li><a href="/campus-ambassador-program">Campus Ambassador</a></li> </ul> </div> <div class="footerLinksCol col-md-3 col-lg-3 col-sm-6 col-12"> <p>Secure Payment</p> <div class="footerAppDownloadRow"> <div class="downloadLinkHolder"> <img src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/common/footer/secure_payment_method.png" class="img-fluid mb-3" width="243" height="28" alt="payment-verified-icon" loading="lazy"> </div> </div> <p>Download Our App</p> <div class="footerAppDownloadRow"> <div class="downloadLinkHolder mobileAppDownload col-md-6 col-lg-6 col-sm-6 col-6 redirection" data-id="1"> <img style="cursor:pointer;" src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/home_page/google-play-svg.svg" alt="SolutionInn - Study Help App for Android" width="116" height="40" class="img-fluid mb-3 " loading="lazy"> </div> <div class="downloadLinkHolder mobileAppDownload col-md-6 col-lg-6 col-sm-6 col-6 redirection" data-id="2"> <img style="cursor:pointer;" src="https://dsd5zvtm8ll6.cloudfront.net/includes/images/rewamp/home_page/apple-store-download-icon.svg" alt="SolutionInn - Study Help App for iOS" width="116" height="40" class="img-fluid mb-3" loading="lazy"> </div> </div> </div> </div> </div> <div class="footer-bottom"> <p>© 2026 SolutionInn. All Rights Reserved</p> </div></footer> <script> window.addEventListener("load",function(){jQuery(document).ready(function(t){ // Clarity tracking (function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "sjv6tuxsok"); // Helper to read a cookie by name function getCookie(name) { return document.cookie .split('; ') .map(v => v.split('=')) .reduce((acc, [k, val]) => (k === name ? decodeURIComponent(val || '') : acc), ''); } // Read cookies var si = getCookie('si_u_id'); var uid = getCookie('u_id'); var zen = getCookie('zenid'); // Send to Clarity if (si) clarity('set', 'si_u_id', si); if (uid) clarity('set', 'u_id', uid); if (zen) clarity('set', 'zenid', zen); clarity('set', 'ip_address', '216.73.216.134'); t.ajax({type:"POST",url:"/",data:{trackUserActivity:!0,reqUri:document.URL,referer:document.referrer},success:function(t){}})})},!1),window.addEventListener("load",function(){jQuery(document).ready(function(t){t.ajax({type:"POST",url:"/",data:{insertCrawler:!0,reqUri:document.URL,parseTime:"0.056",queryTime:"0.01654768548584",queryCount:"30"},success:function(t){}})})},!1),window.addEventListener("load",function(){jQuery(document).ready(function(){function t(t="",n=!1){var i="itms-apps://itunes.apple.com/app/id6462455425",e="openApp://action?"+t;isAndroid()?(setTimeout(function(){return window.location="market://details?id=com.solutioninn.studyhelp",!1},25),window.location=e):isIOS()?(setTimeout(function(){return window.location=i,!1},25),window.location=e):(i="https://apps.apple.com/in/app/id6462455425",n&&(i="https://play.google.com/store/apps/details?id=com.solutioninn.studyhelp"),window.open("about:blank","_blank").location.href=i)}jQuery("#appModal").modal("show"),jQuery(".download-app-btn").click(function(){t(jQuery(this).attr("data-question-open-url"))}),jQuery(".redirection").click(function(){var n=jQuery(this).attr("data-question-open-url"),i=jQuery(this).attr("data-id");void 0!=n?1==i?t(n,!0):t(n,!1):1==i?t("",!0):t("",!1)}),jQuery(".app-notification-close").click(function(){jQuery(".app-notification-section").css("visibility","hidden");var t=new FormData;t.append("hide_notification",!0),jQuery.ajax({type:"POST",url:"/",data:t,cache:!1,contentType:!1,processData:!1,beforeSend:function(){},success:function(t){location.reload()}})})})},!1); </script> </body> </html>