English | česky | Deutsch | >> Español << ZVON > Tutorials > Regular Expressions Tutorial
>> Ejemplo 17 << | Anterior | Siguiente | Contenido | Expresiones Regulares

Descripción


De manera implícita cualquier patrón tiene tantas ocurrencias como sea posible. Esto puede ser cambiado para que tenga el menor número de ocurrencias, al colocar el símbolo de ?. Compara los resultados entre "*" (Caso 1) contra "*?" (Caso 2), "+" (Caso 3) contra "+?" (Caso 4), y "?" (Caso 5) contra "??" (Caso 6).

Código Fuente


One ring to bring them all and in the darkness bind them

Caso 1


Expresión Regular: r.*
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them

Caso 2


Expresión Regular: r.*?
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them

Caso 3


Expresión Regular: r.+
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them

Caso 4


Expresión Regular: r.+?
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them

Caso 5


Expresión Regular: r.?
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them

Caso 6


Expresión Regular: r.??
Primera Ocurrencia:One ring to bring them all and in the darkness bind them
Todas Las Ocurrencias:One ring to bring them all and in the darkness bind them