Question: 2. 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} (10 points, each 2
2. 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} (10 points, each 2 points) 1) Valid URL beginning with http://. (e.g. https://www.michigan.edu)
2) 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.
3) 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.xy@g3.com, cdcd@12_3.net)
4) Phone number in any of the following format: 999-9999999,999-999-9999, (999)-9999999. (Note: all of these formats should be matched by a single regular expression) 5) Valid HTML link tag with the format: ... . (e.g. OReilly Media , Download Test )
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
