This page: https://fr.wikibooks.org/wiki/S%27initier_au_boulier_en_10_le%C3%A7ons/Version_imprimable comes from https://fr.wikibooks.org/wiki/Module:Version_imprimable
Today, I've noticed that "Leçon 2" was not included, because it was treated as "Leçon"
That's how I've observed a difference of treatment of the number "2" by the Lua. Actually it's removed as if it was a part of the return code (which is also 2) instead of the result:
mw.log( mw.text.trim(mw.ustring.gsub("* [[S'initier au boulier en 10 leçons/Leçon 1|Bases et vocabulaire]]", "[ \*\#\[<small>]*([^\|]*).*", "%1")))
S'initier au boulier en 10 leçons/Leçon 1
mw.log( mw.text.trim(mw.ustring.gsub("* [[S'initier au boulier en 10 leçons/Leçon 2|Bases et vocabulaire]]", "[ \*\#\[<small>]*([^\|]*).*", "%1")))
S'initier au boulier en 10 leçons/Leçon
mw.log( mw.text.trim(mw.ustring.gsub("* [[S'initier au boulier en 10 leçons/Leçon 3|Bases et vocabulaire]]", "[ \*\#\[<small>]*([^\|]*).*", "%1")))
S'initier au boulier en 10 leçons/Leçon 3