Here are a bunch of regex exercises. Enjoy! Match a string consisting entirely of digits. \d+ Match a string with only alphanumeric characters and with length at least 4. \p{Alnum}{4,} Match a string containing two words that are the same. .*\b(\w+)\b.*\1.* Match a string containing 4 consecutive lowercase consonants. [a-z&&[^euioa]]{4} Match a person's name, for example Harry Potter. The name is assumed to consist of two words, each starting with a capital letter and consisting entirely of letters (from the usual alphabet, without accents). There may be one or more white space characters separating the two parts. [A-Z][a-z]+\s+[A-Z][a-z]+ Match a valid postal code, for example M5R 1E4 (with one space in between). [A-Z]\d[A-Z] \d[A-Z]\d Match a valid postal code with all digits the same, for example M5R 5E5. [A-Z](\d)[A-Z] \1[A-Z]\1 Match a string that represents time in HH:mm:ss format. HH is hours between 01 and 12. mm and ss represent minutes and seconds, and each is between 00 and 59. Valid examples include 01:26:18 and 11:00:39. Invalid examples include 13:01:01, 00:00:00, and 01:00:60. Consider this file format: ANA300Y1Y Human Anat Histol LEC010103500325000 ANA301H1S Human Embryology LEC010105000500054 ANA498Y1Y Research Project LEC010199990012000 ANT100Y1Y Intro Anthropology LEC510112501129000 ANT200Y1Y Intro Archaeology LEC510103000281000 CSC148H1S Intro to Comp Sci LEC010201000061000 CSC148H1S Intro to Comp Sci LEC510101200117000 CSC148H1S Intro to Comp Sci TUT010100600060000 CSC148H1S Intro to Comp Sci TUT020100480019000 CSC207H1F Software Design LEC010101200096000 CSC207H1F Software Design LEC510100850043000 Lecture Term Course title LEC/TUT? SEC CAP ENRLMT WAITING LIST You can assume that the number of characters before the first tab character and between successive tab characters is always the same in every line of the file. 1) Write a regular expression to match the lecture (“LEC”) sections of fall-term courses with names beginning “Intro”. Group the course codes (“XXX123..”) and section numbers (for example, 5203) so that they can be extracted from the matched substring. 2) The third-to-last and second-to-last columns indicate the enrolment cap and the actual enrolment. Write a regular expression to match every line where the enrolment is at the cap. 3) Write a regular expression to match any line where the course title is shorter than 10 characters, not including trailing blanks. For example, the course title for CSC148H1 is “Intro to Comp Sci”. There is no need to group any part of the string, though you may do so if you find it helps. (There are 30 characters in the course title area of each line. At least the first character of the title must be non-blank.)