O GoConqr está de visual novo! Conte para nós o que você achou.

Módulo 17 de 33 · Mídia

Alternatives and optionals

Kostas Diakogiannis

Alternatives and optionals

Alternatives and optionals

With a ? question mark, we can specify that a part of the string is optional and could be additionally accepted if there, but not mandatory. 

The main difference between optionals and alternatives is that optionals mean, that either this character will be put or nothing, alternatives in contrast mean either the one, or the other one. But in the end for sure something. Nothing is not an option.

If we don't want to have partial match we can specify that the string that we are testing on should should begin and end with the pattern we have, and it is not a subset of a bigger string. To specify that this is the beginning we do it with the ^ character, and the end with a $ dollar sign character.
 

Instruções

Para avançar no curso, envie uma tentativa deste quiz. Você pode enviá-la depois da última pergunta.

Ir para o módulo escolhido

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?