Regular Expression in Javascript

@T-Bone

This question paper focuses on the "Regular Expression" of Javascript. These Multiple Choice Questions (mcq) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

This question paper focuses on the "Regular Expression" of Javascript. These Multiple Choice Questions (mcq) should be practiced to improve the Javascript skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.

Questions

1. Which among the following regular expression specifies that password should contain at least one capital letter or one digit.

Mark the correct option

2. Which of the following string will match the RegEx "((d).(dd))$"?

Mark the correct option

3. Consider the following JavaScript statement containing regular expressions and check if the pattern matches? var text = "lestfindcourse: 1, 2, 3"; var pattern = /d+/g;

Mark the correct option

4. The regular expression to match any one character not between the brackets is __________

Mark the correct option

5. What would be the result of the following statement in JavaScript using regular expression methods?

Mark the correct option

6. What will be the output of the following JavaScript code? System.out.println( Pattern.matches("[lfc]", "lets") );

Mark the correct option

7. What will be the output of the following JavaScript code? System.out.println( Pattern.matches("[lfc]?", "l") );

Mark the correct option

8. What will be the output of the following JavaScript code? System.out.println( Pattern.matches("\d", "9") );

Mark the correct option

9. What will be the output of the following JavaScript code? System.out.println( Pattern.matches("[^lfc]", "letsfind") );

Mark the correct option

10. What will be the output of the following JavaScript code? System.out.println( Pattern.matches("[lfc]+", "f") );

Mark the correct option

Index of Questions