The word boundaryLa limite de mot

A space on either side of a word is the obvious way of delimiting it, but it fails as soon as the word touches anything but a space: a word can be followed by a comma, preceded by an apostrophe, or come at the start of a line. \b detects all of those boundaries at once. It matches the position between a “word” character (\w, so an unaccented letter, a digit or an underscore) and a character that is not one (a space, punctuation, the edge of the text).

Like the anchors ^ and $, \b matches no character: it marks a position. /\bcat\b/ finds the word “cat” on its own, not “catalogue” or “bobcat”.

ExerciseExercice 5 · words starting with a capitalmots commençant par une majuscule basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the first letter of every word that starts with a capital.
Trouvez la première lettre de chaque mot commençant par une majuscule.
Test textTexte de test
The Cat eats. It is Small but Agile.
Le Chat mange. Il est Petit mais Agile.
Expected matches:Correspondances attendues : L C I P A
Expected matches:Correspondances attendues : T C I S A
//gmu
ExerciseExercice 6 · three-letter acronymsacronymes de 3 lettres basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the acronyms made of exactly three capital letters (such as UNO or FBI).
Trouvez les acronymes composés d'exactement 3 lettres majuscules (comme ONU ou FBI).
Test textTexte de test
The organisations UNO, UNESCO and NASA are important. The WTO and the FBI too. The word USA is well known. EU and USSR as well.
Les organisations ONU, UNESCO et NASA sont importantes. L'OMC et le FBI aussi. Le mot USA est connu. UE et URSS aussi.
Expected matches:Correspondances attendues : ONU OMC FBI USA
Expected matches:Correspondances attendues : UNO WTO FBI USA
//gmu
ExerciseExercice 7 · double initialsinitiales doubles basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find authors’ double initials (two capitals with periods, such as "J.K." or "C.S.").
Trouvez les initiales doubles d'auteurs et d'autrices (deux majuscules à points, comme « J.K. » ou « C.S. »).
Test textTexte de test
The authors J.K. Rowling, C.S. Lewis and George Orwell are famous. You also find J. Austen, J-P. Sartre, E.B. White, T.S. Eliot and F.D.R. Roosevelt.
Les auteurs J.K. Rowling, C.S. Lewis et George Orwell sont célèbres. On trouve aussi J. Austen, J-P. Sartre, E.B. White, T.S. Eliot et F.D.R. Roosevelt.
Expected matches:Correspondances attendues : J.K. C.S. E.B. T.S. F.D.
Expected matches:Correspondances attendues : J.K. C.S. E.B. T.S. F.D.
//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 2026-08-30

Une espace de chaque côté d’un mot, c’est la façon évidente de le délimiter, mais elle échoue dès que le mot touche autre chose qu’une espace : un mot peut être suivi d’une virgule, précédé d’une apostrophe, ou placé en début de ligne. Le \b détecte toutes ces limites d’un coup. Il correspond à la position entre un caractère « de mot » (\w, donc lettre non accentuée, chiffre ou trait de soulignement) et un caractère qui n’en est pas un (espace, ponctuation, bord du texte).

Comme les ancres ^ et $, \b ne correspond à aucun caractère : il marque une position. /\bchat\b/ trouve le mot « chat » seul, pas « chatouiller » ni « achat ».

ExerciseExercice 5 · words starting with a capitalmots commençant par une majuscule basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the first letter of every word that starts with a capital.
Trouvez la première lettre de chaque mot commençant par une majuscule.
Test textTexte de test
The Cat eats. It is Small but Agile.
Le Chat mange. Il est Petit mais Agile.
Expected matches:Correspondances attendues : L C I P A
Expected matches:Correspondances attendues : T C I S A
//gmu
ExerciseExercice 6 · three-letter acronymsacronymes de 3 lettres basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find the acronyms made of exactly three capital letters (such as UNO or FBI).
Trouvez les acronymes composés d'exactement 3 lettres majuscules (comme ONU ou FBI).
Test textTexte de test
The organisations UNO, UNESCO and NASA are important. The WTO and the FBI too. The word USA is well known. EU and USSR as well.
Les organisations ONU, UNESCO et NASA sont importantes. L'OMC et le FBI aussi. Le mot USA est connu. UE et URSS aussi.
Expected matches:Correspondances attendues : ONU OMC FBI USA
Expected matches:Correspondances attendues : UNO WTO FBI USA
//gmu
ExerciseExercice 7 · double initialsinitiales doubles basicbasique not startedà faire solvedréussi keep tryingà retravailler
Find authors’ double initials (two capitals with periods, such as "J.K." or "C.S.").
Trouvez les initiales doubles d'auteurs et d'autrices (deux majuscules à points, comme « J.K. » ou « C.S. »).
Test textTexte de test
The authors J.K. Rowling, C.S. Lewis and George Orwell are famous. You also find J. Austen, J-P. Sartre, E.B. White, T.S. Eliot and F.D.R. Roosevelt.
Les auteurs J.K. Rowling, C.S. Lewis et George Orwell sont célèbres. On trouve aussi J. Austen, J-P. Sartre, E.B. White, T.S. Eliot et F.D.R. Roosevelt.
Expected matches:Correspondances attendues : J.K. C.S. E.B. T.S. F.D.
Expected matches:Correspondances attendues : J.K. C.S. E.B. T.S. F.D.
//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 2026-08-30

Sources

Sources

Spotted an error? Une erreur ?

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

Sending opens your mail app with the report addressed to me. L'envoi ouvre votre application de courriel avec le signalement déjà adressé à moi.