Regular Expressions - 1,2

Descrição

Quiz sobre Regular Expressions - 1,2, criado por Zarina Kiyakhmetova em 20-12-2018.
Zarina Kiyakhmetova
Quiz por Zarina Kiyakhmetova , atualizado more than 1 year ago
Zarina Kiyakhmetova
Criado por Zarina Kiyakhmetova mais de 5 anos atrás
137
2

Resumo de Recurso

Questão 1

Questão
PHP has long supported two regular expression implementations known as _______ and _______ i) Perl ii) PEAR iii) Pearl iv) POSIX
Responda
  • a) i) and ii)
  • b) ii) and iv)
  • c) i) and iv)
  • d) ii) and iii)

Questão 2

Questão
Which one of the following regular expression matches any string containing zero or one p?
Responda
  • a) p+
  • b) p*
  • c) P?
  • d) p#

Questão 3

Questão
[:alpha:] can also be specified as..
Responda
  • a) [A-Za-z0-9].
  • b) [A-za-z].
  • c) [A-z].
  • d) [a-z].

Questão 4

Questão
How many functions does PHP offer for searching strings using POSIX style regular expression?
Responda
  • a) 7
  • b) 8
  • c) 9
  • d) 10

Questão 5

Questão
What will be the output of the following PHP code?
Responda
  • a) Error
  • b) Username must be all lowercase!
  • c) Username is all lowercase!
  • d) No Output is returned

Questão 6

Questão
POSIX implementation was deprecated in which version of PHP?
Responda
  • a) PHP 4
  • b) PHP 5
  • c) PHP 5.2
  • d) PHP 5.3

Questão 7

Questão
POSIX stands for
Responda
  • a) Portable Operating System Interface for Unix
  • b) Portable Operating System Interface for Linux
  • c) Portative Operating System Interface for Unix
  • d) Portative Operating System Interface for Linux

Questão 8

Questão
What will be the output of the following PHP code?
Responda
  • a) this is some text that we might like to parse.
  • b) Array ( [0] => some text that [1] => we might like to parse. )
  • c) Array ( [0] => this is [1] => some text that [2] => we might like to parse. )
  • d) [0] => this is [1] => some text that [2] => we might like to parse.

Questão 9

Questão
Which 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
Responda
  • a) Only i)
  • b) ii) and iii)
  • c) i), iii) and iv)
  • d) i) and iv)

Questão 10

Questão
Which among the following is/are not a metacharacter? i) \a ii) \A iii) \b iv) \B
Responda
  • a) Only i)
  • b) i) and iii)
  • c) ii), iii) and iv)
  • d) ii) and iv)

Questão 11

Questão
How many functions does PHP offer for searching and modifying strings using Perl-compatible regular expressions.
Responda
  • a) 7
  • b) 8
  • c) 9
  • d) 10

Questão 12

Questão
What will be the output of the following PHP code?
Responda
  • a) Array ( [0] => pasta [1] => steak [2] => fish [3] => potatoes )
  • b) Array ( [3] => potatoes )
  • c) Array ( [1] => steak )
  • d) Array ( [0] => potatoes )

Questão 13

Questão
Say we have two compare two strings which of the following function/functions can you use? i) strcmp() ii) strcasecmp() iii) strspn() iv) strcspn()
Responda
  • a) i) and ii)
  • b) iii) and iv)
  • c) None of the mentioned
  • d) All of the mentioned

Questão 14

Questão
Which one of the following functions will convert a string to all uppercase?
Responda
  • a) strtoupper()
  • b) uppercase()
  • c) str_uppercase()
  • d) struppercase()

Questão 15

Questão
What will be the output of the following PHP code?
Responda
  • a) O’Malley Wins The Heavyweight Championship!
  • b) O’malley Wins The Heavyweight Championship!
  • c) O’Malley wins the heavyweight championship!
  • d) o’malley wins the heavyweight championship!

Questão 16

Questão
What will be the output of the following PHP code?
Responda
  • a) SaladSaladSaladSaladSalad is good
  • b) is good SaladSaladSaladSaladSalad
  • c) is good Salad
  • d) Salad is good

Questão 17

Questão
Which one of the following functions can be used to concatenate array elements to form a single delimited string?
Responda
  • a) explode()
  • b) implode()
  • c) concat()
  • d) concatenate()

Questão 18

Questão
Which one of the following functions finds the last occurrence of a string, returning its numerical position?
Responda
  • a) strlastpos()
  • b) strpos()
  • c) strlast()
  • d) strrpos()

Questão 19

Questão
What will be the output of the following PHP code?
Responda
  • a) Contact the author of this article at nachiketh@ex@mple.com
  • b) Cont@ct the @uthor of this @rticle @t n@chiketh@ex@mple.com
  • c) Contact the author of this article at n@chiketh@ex@mple.com
  • d) Error

Questão 20

Questão
What will be the output of the following PHP code?
Responda
  • a) nachiketh@example.com
  • b) nachiketh
  • c) nachiketh@
  • d) example.com

Semelhante

SUS E ATENÇÃO A SAÚDE NO BRASIL
danieleyuri
Vocabulário de Espanhol
Debis
Etica da Advocacia
kellisim
Molaridade
Alessandra S.
Princípios Direito Penal
Carlos Moradore
Funções administrativas
brunocmt
Plano de Estudos com Mapas Mentais
Alessandra S.
Entidades da Administração Indireta
roberta.dams
Substantivos
Peter Ensi
Célula Animal X Célula Vegetal
Marília Mendes
Vitaminas
Júlia Figueiredo