Quiz 4



Q13. Which of the following strings do not match the pattern http://[a-z]{2,10}.com

A. http://google.com
B. http://123india.com
C. http://yahoo.com
D. http://masn.com


Q14. Which of the following is false

A. Pattern ^[1-9]{1,2}$ matches string 123india
B. Pattern ^1-800-[0-9]{3}-[1-9]{4}$ matches 1-800-567-3504
C. Pattern ^[a-zA-Z0-9]{7}$ matches John123
D. Pattern ^[0-9]{1,2}$ matches 24


Q15. Which of the following is true

A. Pattern ^[a-zA-Z0-9]{2,5}.com$ matches google.com
B. Pattern ^[a-zA-Z0-9]{4}.com$ matches msn.com
C. Pattern ^[a-zA-Z0-9]{2,5}.com$ matches yahoo.com
D. Pattern ^[a-zA-Z0-9]{2,5}.com$ matches hotmail.com


Q16. Consider following javascript statements

var pattern1=new RegExp("rachael$");
var string1 = "A very common name in US is rachael";
What is the result of pattern1.test(string1)


A. True
B. False