Volby 2006

názory a postoje 500 kandidátů do poslanecké sněmovny za

ČSSD, KDU-ČSL, KSČM, ODS a Stranu zelených.


English | >> česky << | Deutsch | Español ZVON > Tutorials > Regular Expressions Tutorial
>> Příklad 17 << | Předešlý | Následující | Obsah | Regulární výrazy

Popis


Implicitně jsou všechny "subpatterns" nalezeny tolikrát, kolikrát to jen jde. Toto chování může být změněno na nalezení co nejmenšího počtu, pokud je kvantifikátor následován otazníkem. Srovnej "*" (Případ 1) s "*?" (Případ 2), "+" (Případ 3) s "+?" (Případ 4), a "?" (Případ 5) s "??" (Případ 6).

Zdroj


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

Případ 1


Regulární výraz: r.*
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them

Případ 2


Regulární výraz: r.*?
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them

Případ 3


Regulární výraz: r.+
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them

Případ 4


Regulární výraz: r.+?
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them

Případ 5


Regulární výraz: r.?
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them

Případ 6


Regulární výraz: r.??
První zásah:One ring to bring them all and in the darkness bind them
Všechny zásahy:One ring to bring them all and in the darkness bind them