Write down the extended regular expression for following questions E.g. Social s
ID: 3790406 • Letter: W
Question
Write down the extended regular expression for following questions E.g. Social security number in the format of 999-99-9999. Answer: [0-9]{3}-[0-9]{2}-[0-9]{4} Valid URL beginning with "http://", (e.g. http://cs.gsu.edul Valid variable name following the two rules below: Must begin with a letter of the alphabet, an underscore, or (-) or a dollar sign [$] After the first initial letter, variable names may also contain letters and the digits 0 to 9. Valid email address, assuming 'a-z', '0-9', '-', ''.are valid characters for user id and domain name has to be end with either ".com" or ".net" (e.g. aabb 123.xv@g3.com. cdcd@12_3.netl Phone number in any of the following format: 999-9999999, 999-999-9999, (999)-9999999. Valid HTML link tag with the format: ...Explanation / Answer
1. find url beginning: ([--:w?@%&+~#=]*.[a-z]{2,4}/{0,2})((?:[?&](?:w+)=(?:w+))+|[--:w?@%&+~#=]+)? 2. variable name [a-zA-Z_]+([a-zA-Z0-9_]*) 3. email - standard email regex used. can find 99% of emails (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[--!#-[]-]|\[- -])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[--!-ZS-]|\[- -])+)]) 4. phone number ((?+?d{1,3})?[s-]+)?(?d{1,3})?[s-]+d{3}[s-]?d{2}[s-]?d{2} 5. anchor tags:Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.