Quiz
Regular Expressions - 1,2
Crie uma conta grátis para terminar este quiz
Salve seu progresso e veja sua nota final.
Já tem uma conta? Inicie sessão
Perguntas do quiz (20)
1 PHP has long supported two regular expression implementations known as _______ and _______
i) Perl
ii) PEAR
iii) Pearl
iv) POSIX- Aa) i) and ii)
- Bb) ii) and iv)
- Cc) i) and iv)
- Dd) ii) and iii)
2Which one of the following regular expression matches any string containing zero or one p?
- Aa) p+
- Bb) p*
- Cc) P?
- Dd) p#
3[:alpha:] can also be specified as..
- Aa) [A-Za-z0-9].
- Bb) [A-za-z].
- Cc) [A-z].
- Dd) [a-z].
4How many functions does PHP offer for searching strings using POSIX style regular expression?
- Aa) 7
- Bb) 8
- Cc) 9
- Dd) 10
5What will be the output of the following PHP code?

- Aa) Error
- Bb) Username must be all lowercase!
- Cc) Username is all lowercase!
- Dd) No Output is returned
6POSIX implementation was deprecated in which version of PHP?
- Aa) PHP 4
- Bb) PHP 5
- Cc) PHP 5.2
- Dd) PHP 5.3
7POSIX stands for
- Aa) Portable Operating System Interface for Unix
- Bb) Portable Operating System Interface for Linux
- Cc) Portative Operating System Interface for Unix
- Dd) Portative Operating System Interface for Linux
8What will be the output of the following PHP code?

- Aa) this is some text that we might like to parse.
- Bb) Array ( [0] => some text that [1] => we might like to parse. )
- Cc) Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
- Dd) [0] => this is [1] => some text that [2] => we might like to parse.
9Which of the following would be a potential match for the Perl-based regular expression /fo{2,4}/ ?
i) fol
ii) fool
iii) fooool
iv) fooooool- Aa) Only i)
- Bb) ii) and iii)
- Cc) i), iii) and iv)
- Dd) i) and iv)
10Which among the following is/are not a metacharacter?
i) \a
ii) \A
iii) \b
iv) \B- Aa) Only i)
- Bb) i) and iii)
- Cc) ii), iii) and iv)
- Dd) ii) and iv)
11How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
- Aa) 7
- Bb) 8
- Cc) 9
- Dd) 10
12What will be the output of the following PHP code?

- Aa) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes )
- Bb) Array ( [3] => potatoes )
- Cc) Array ( [1] => steak )
- Dd) Array ( [0] => potatoes )
13Say we have two compare two strings which of the following function/functions can you use?
i) strcmp()
ii) strcasecmp()
iii) strspn()
iv) strcspn()- Aa) i) and ii)
- Bb) iii) and iv)
- Cc) None of the mentioned
- Dd) All of the mentioned
14Which one of the following functions will convert a string to all uppercase?
- Aa) strtoupper()
- Bb) uppercase()
- Cc) str_uppercase()
- Dd) struppercase()
15What will be the output of the following PHP code?

- Aa) O’Malley Wins The Heavyweight Championship!
- Bb) O’malley Wins The Heavyweight Championship!
- Cc) O’Malley wins the heavyweight championship!
- Dd) o’malley wins the heavyweight championship!
16What will be the output of the following PHP code?

- Aa) SaladSaladSaladSaladSalad is good
- Bb) is good SaladSaladSaladSaladSalad
- Cc) is good Salad
- Dd) Salad is good
17Which one of the following functions can be used to concatenate array elements to form a single delimited string?
- Aa) explode()
- Bb) implode()
- Cc) concat()
- Dd) concatenate()
18Which one of the following functions finds the last occurrence of a string, returning its numerical position?
- Aa) strlastpos()
- Bb) strpos()
- Cc) strlast()
- Dd) strrpos()
19What will be the output of the following PHP code?

- Aa) Contact the author of this article at nachiketh@ex@mple.com
- Bb) Cont@ct the @uthor of this @rticle @t n@chiketh@ex@mple.com
- Cc) Contact the author of this article at n@chiketh@ex@mple.com
- Dd) Error
20What will be the output of the following PHP code?

- Aa) nachiketh@example.com
- Bb) nachiketh
- Cc) nachiketh@
- Dd) example.com
Informações
- Descrição
- Quiz sobre Regular Expressions - 1,2, criado por Zarina Kiyakhmetova em 20-12-2018.
- Autor
- Zarina Kiyakhmetova
- Idioma
- English
- Visualizações
- 154
- Avaliação
- Ainda sem avaliações Avalie este quiz