Home > PHP & Programming > Quizzes > Practice Test: Perl Regular Expressions In PHP
Practice Test: Perl Regular Expressions In PHP
Fast practice, instant feedback. Timer auto-submits when time’s up.
Avg score: 86% Most missed: “State, whether the following statements about metacharacters in regular expressi…”
Practice Test: Perl Regular Expressions In PHP
Time left 00:00
21 Questions

1. The … function searches all elements of an array, returning an array consisting of all elements matching a certain pattern.
2. … will match en, whether the string appears in isolation or is followed by one or more characters.
3. The modifier… will allow for ^ and $ to match at the beginning of any line in a string.
4. The … function operates in a fashion identical to the preg_replace() function, except that, rather than returning a modified result, only matches are returned.
5. … will match en, whether the string appears in isolation or is followed by one or more characters.
6. … is the modifier of Perl based regular expression in PHP which treats the string as a single line, ignore any newline characters found within.
7. The … function searches a string for a specific pattern, returning TRUE if it exists and FALSE otherwise.
8. PHP offers … functions for searching and modifying strings using Perl compatible regular expressions.
9. State, whether the following statements about metacharacters in regular expressions are TRUE or FALSE.
i. $ matches the end of a line.
ii. / quotes the next metacharacter.
iii. [] encloses a character grouping.
10. The … function inserts a backslash delimiter before every character of special significance to regular expression syntax.
11. Which of the following is the correct syntax of using the function preg_quote().
12. State, whether the following statements about metacharacters of Perl-based regular expressions are TRUE.
i. \A matches only at the beginning of the string.
ii. \b matches anything but a word boundary.
iii. \d matches a digit character.
13. State, whether the following statements about the modifiers of Perl-based regular expressions are TRUE or FALSE.
i. The modifier I will perform a case-insensitive search.
ii.The modifier S will perform a case-sensitive search.
14. The … function searches all elements of an array, returning an array consisting of all elements matching a certain pattern.
15. The … function searches a string for a specific pattern, returning TRUE if it exists and FALSE otherwise.
16. State, whether the following statements about the modifiers of Perl-based regular expressions are TRUE or FALSE.
i. The modifier I will perform a case-insensitive search.
ii.The modifier S will perform a case-sensitive search.
17. The … function operates in a fashion identical to the preg_replace() function, except that, rather than returning a modified result, only matches are returned.
18. The … functions replaces all occurrences of pattern with replacement and returns the modified result.
19. … is the modifier of Perl based regular expression in PHP which will ignore white space and comments within the regular expression.
20. PHP offers … functions for searching and modifying strings using Perl compatible regular expressions.
21. The modifier… will allow for ^ and $ to match at the beginning of any line in a string.