Shorthand quantifiers: *, +, ?Quantificateurs abrégés : *, +, ?

The most frequent repetitions have a symbol of their own:

SymbolEquivalentMeaning
*{0,}0 or more
+{1,}1 or more
?{0,1}0 or 1 (optional)

Examples:

  • colou?r → “color” or “colour”: the “u” is optional;
  • \d+ → one or more digits;
  • \s* → zero or more whitespace characters.

The ? deserves particular attention: it is the one that describes a variation, and a spelling variation is exactly what a language professional spends time looking for. A doubled letter or not, an optional accent, a plural “s”, a British spelling against an American one.

ExerciseExercice 3 · British and American spellingsorthographes britannique et américaine basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find "color" and "colour" (the American and British spellings) in one expression.
Trouvez « color » et « colour » (orthographes américaine et britannique) en une seule expression.
Test textTexte de test
The color of the flag is red. The colour of the sky is blue. I prefer colorful pictures over colourful ones. The colony and the column are different.
The color of the flag is red. The colour of the sky is blue. I prefer colorful pictures over colourful ones. The colony and the column are different.
Expected matches:Correspondances attendues : color colour color colour
Expected matches:Correspondances attendues : color colour color colour
//gmu
ExerciseExercice 4 · a word and its common misspellingun mot et sa faute courante basicbasique not startedà faire solvedréussi keep tryingà retravailler
You want to find every occurrence of the word "address" in a text, whether it is spelled correctly (two d's) or with the common mistake "adress" (one d). Write one expression that finds both forms, but not the variants with three d's or more.
Vous voulez trouver toutes les occurrences du mot « adresse » dans un texte, qu'il soit bien orthographié (deux s) ou écrit avec la faute courante « adrese » (un seul s). Écrivez une seule expression qui trouve les deux formes, mais pas les variantes à 3 s ou plus.
Test textTexte de test
Here is my full address. I have a temporary adress. The postal address and the email adress are different. Beware of the adddress with three d's.
Voici mon adresse complète. J'ai une adrese temporaire. L'adresse postale et l'adrese courriel sont différentes. Attention à l'adresssse avec 4 s.
Expected matches:Correspondances attendues : adresse adrese adresse adrese
Expected matches:Correspondances attendues : address adress address adress
//gmu
ExerciseExercice 5 · whole numbersnombres entiers basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find every run of digits, whatever its length.
Trouvez toutes les suites de chiffres, quelle que soit leur longueur.
Test textTexte de test
I ordered 3 books, 15 pens and 127 sheets of paper, but it took me 3462814235413 hours! The price is 12.50$.
J'ai commandé 3 livres, 15 stylos et 127 feuilles de papier, mais ça m'a pris 3462814235413 heures! Le prix est 12.50$.
Expected matches:Correspondances attendues : 3 15 127 3462814235413 12 50
Expected matches:Correspondances attendues : 3 15 127 3462814235413 12 50
//gmu
ExerciseExercice 6 · repeated punctuationponctuation répétée basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the runs of at least 2 consecutive punctuation marks (. ! ?).
Trouvez les séquences d'au moins 2 signes de ponctuation consécutifs (. ! ?).
Test textTexte de test
That is amazing!!! Really??? Wait... No! Yes. Maybe? Absolutely!! Ellipsis... And!? really?!
C'est incroyable!!! Vraiment??? Attendez... Non! Oui. Peut-être? Absolument!! Points de suspension... Et!? vraiment?!
Expected matches:Correspondances attendues : !!! ??? ... !! ... !? ?!
Expected matches:Correspondances attendues : !!! ??? ... !! ... !? ?!
//gmu
ExerciseExercice 7 · multiple spacesespaces multiples intermediateintermédiaire not startedà faire solvedréussi keep tryingà retravailler
Find the runs of 2 whitespace characters or more (useful for cleaning up formatting).
Trouvez les séquences de 2 blancs ou plus (utile pour nettoyer la mise en forme).
Test textTexte de test
Here  is a text   with    multiple spaces. But not here. One only here too.
Voici  un texte   avec    des espaces multiples. Mais pas ici. Un seul ici aussi.
Expected matches:Correspondances attendues : ␣␣ ␣␣␣ ␣␣␣␣ ␣ space · ⇥ tab · ⏎ line break · ◆ empty match␣ espace · ⇥ tabulation · ⏎ retour à la ligne · ◆ correspondance vide
Expected matches:Correspondances attendues : ␣␣ ␣␣␣ ␣␣␣␣ ␣ space · ⇥ tab · ⏎ line break · ◆ empty match␣ espace · ⇥ tabulation · ⏎ retour à la ligne · ◆ correspondance vide
//gmu
ExerciseExercice 8 · the start of http and https URLsdébuts d'URL http et https basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the URL openings "http://" and "https://" (not the other protocols).
Trouvez les débuts d'URL « http:// » et « https:// » (pas les autres protocoles).
Test textTexte de test
Visit http://example.com or https://secure.com for more. The ftp:// protocol is not included. Nor file://local nor mailto:test@test.com.
Visitez http://example.com ou https://secure.com pour plus d'infos. Le protocole ftp:// n'est pas inclus. Ni file://local ni mailto:test@test.com.
Expected matches:Correspondances attendues : http:// https://
Expected matches:Correspondances attendues : http:// https://
//gmu
Written alternately in EN and FR, translation partly generated in both directions. Rédigé en alternance en EN et en FR, traduction en partie générée dans les deux sens. Updated 22 September 2026

Les cas de répétition les plus fréquents ont leur symbole dédié :

SymboleÉquivalentSignification
*{0,}0 ou plus
+{1,}1 ou plus
?{0,1}0 ou 1 (optionnel)

Exemples :

  • colou?r → « color » ou « colour » : le « u » est optionnel ;
  • \d+ → un ou plusieurs chiffres ;
  • \s* → zéro ou plusieurs blancs.

Le ? mérite une attention particulière : c’est lui qui décrit une variation, et une variation orthographique est exactement ce qu’un langagier passe son temps à chercher. Une lettre doublée ou non, un accent facultatif, un « s » de pluriel, une graphie britannique et une américaine.

ExerciseExercice 3 · British and American spellingsorthographes britannique et américaine basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find "color" and "colour" (the American and British spellings) in one expression.
Trouvez « color » et « colour » (orthographes américaine et britannique) en une seule expression.
Test textTexte de test
The color of the flag is red. The colour of the sky is blue. I prefer colorful pictures over colourful ones. The colony and the column are different.
The color of the flag is red. The colour of the sky is blue. I prefer colorful pictures over colourful ones. The colony and the column are different.
Expected matches:Correspondances attendues : color colour color colour
Expected matches:Correspondances attendues : color colour color colour
//gmu
ExerciseExercice 4 · a word and its common misspellingun mot et sa faute courante basicbasique not startedà faire solvedréussi keep tryingà retravailler
You want to find every occurrence of the word "address" in a text, whether it is spelled correctly (two d's) or with the common mistake "adress" (one d). Write one expression that finds both forms, but not the variants with three d's or more.
Vous voulez trouver toutes les occurrences du mot « adresse » dans un texte, qu'il soit bien orthographié (deux s) ou écrit avec la faute courante « adrese » (un seul s). Écrivez une seule expression qui trouve les deux formes, mais pas les variantes à 3 s ou plus.
Test textTexte de test
Here is my full address. I have a temporary adress. The postal address and the email adress are different. Beware of the adddress with three d's.
Voici mon adresse complète. J'ai une adrese temporaire. L'adresse postale et l'adrese courriel sont différentes. Attention à l'adresssse avec 4 s.
Expected matches:Correspondances attendues : adresse adrese adresse adrese
Expected matches:Correspondances attendues : address adress address adress
//gmu
ExerciseExercice 5 · whole numbersnombres entiers basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find every run of digits, whatever its length.
Trouvez toutes les suites de chiffres, quelle que soit leur longueur.
Test textTexte de test
I ordered 3 books, 15 pens and 127 sheets of paper, but it took me 3462814235413 hours! The price is 12.50$.
J'ai commandé 3 livres, 15 stylos et 127 feuilles de papier, mais ça m'a pris 3462814235413 heures! Le prix est 12.50$.
Expected matches:Correspondances attendues : 3 15 127 3462814235413 12 50
Expected matches:Correspondances attendues : 3 15 127 3462814235413 12 50
//gmu
ExerciseExercice 6 · repeated punctuationponctuation répétée basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the runs of at least 2 consecutive punctuation marks (. ! ?).
Trouvez les séquences d'au moins 2 signes de ponctuation consécutifs (. ! ?).
Test textTexte de test
That is amazing!!! Really??? Wait... No! Yes. Maybe? Absolutely!! Ellipsis... And!? really?!
C'est incroyable!!! Vraiment??? Attendez... Non! Oui. Peut-être? Absolument!! Points de suspension... Et!? vraiment?!
Expected matches:Correspondances attendues : !!! ??? ... !! ... !? ?!
Expected matches:Correspondances attendues : !!! ??? ... !! ... !? ?!
//gmu
ExerciseExercice 7 · multiple spacesespaces multiples intermediateintermédiaire not startedà faire solvedréussi keep tryingà retravailler
Find the runs of 2 whitespace characters or more (useful for cleaning up formatting).
Trouvez les séquences de 2 blancs ou plus (utile pour nettoyer la mise en forme).
Test textTexte de test
Here  is a text   with    multiple spaces. But not here. One only here too.
Voici  un texte   avec    des espaces multiples. Mais pas ici. Un seul ici aussi.
Expected matches:Correspondances attendues : ␣␣ ␣␣␣ ␣␣␣␣ ␣ space · ⇥ tab · ⏎ line break · ◆ empty match␣ espace · ⇥ tabulation · ⏎ retour à la ligne · ◆ correspondance vide
Expected matches:Correspondances attendues : ␣␣ ␣␣␣ ␣␣␣␣ ␣ space · ⇥ tab · ⏎ line break · ◆ empty match␣ espace · ⇥ tabulation · ⏎ retour à la ligne · ◆ correspondance vide
//gmu
ExerciseExercice 8 · the start of http and https URLsdébuts d'URL http et https basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the URL openings "http://" and "https://" (not the other protocols).
Trouvez les débuts d'URL « http:// » et « https:// » (pas les autres protocoles).
Test textTexte de test
Visit http://example.com or https://secure.com for more. The ftp:// protocol is not included. Nor file://local nor mailto:test@test.com.
Visitez http://example.com ou https://secure.com pour plus d'infos. Le protocole ftp:// n'est pas inclus. Ni file://local ni mailto:test@test.com.
Expected matches:Correspondances attendues : http:// https://
Expected matches:Correspondances attendues : http:// https://
//gmu
Written alternately in EN and FR, translation partly generated in both directions. Rédigé en alternance en EN et en FR, traduction en partie générée dans les deux sens. Mise à jour 22 septembre 2026

Sources

Sources

Spotted an error? Une erreur ?

Language, content, a broken link: e-mail me what you saw and I will fix it. Langue, contenu, lien brisé : écrivez-moi ce que vous avez vu et je corrige.

ayla.rigouts.terryn@umontreal.ca

Please mention the page: Mentionnez la page :