diff --git a/howto/regex.po b/howto/regex.po index 9901cb22..fd02780d 100644 --- a/howto/regex.po +++ b/howto/regex.po @@ -7,9 +7,9 @@ msgid "" msgstr "" "Project-Id-Version: Python 3.6\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2018-06-10 11:27+0200\n" -"PO-Revision-Date: 2017-08-10 00:58+0200\n" -"Last-Translator: Julien Palard \n" +"POT-Creation-Date: 2018-02-08 09:58+0100\n" +"PO-Revision-Date: 2018-03-26 13:46+0200\n" +"Last-Translator: Nabil Bendafi \n" "Language-Team: \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -19,7 +19,7 @@ msgstr "" #: ../Doc/howto/regex.rst:5 msgid "Regular Expression HOWTO" -msgstr "" +msgstr "Guide des Expressions régulières" #: ../Doc/howto/regex.rst:0 msgid "Author" @@ -39,6 +39,10 @@ msgid "" "Python with the :mod:`re` module. It provides a gentler introduction than " "the corresponding section in the Library Reference." msgstr "" +"Ce document est un guide d'introduction à l'utilisation des expressions " +"régulières en Python avec le module :mod:`re`. Il fournit une introduction plus " +"abordable que la section correspondante dans le guide de référence des " +"bibliothèques." #: ../Doc/howto/regex.rst:24 msgid "Introduction" @@ -56,6 +60,17 @@ msgid "" "match for the pattern anywhere in this string?\". You can also use REs to " "modify a string or to split it apart in various ways." msgstr "" +"Les expressions régulières (appelées RE, ou regexes, ou motifs regex) sont " +"essentiellement un petit langage de programmation hautement spécialisé embarqué " +"dans Python et dont la manipulation est rendue possible par l'utilisation du " +"module :mod:`re`. En utilisant ce petit langage, vous spécifiez les règles pour " +"l'ensemble des chaînes des caractères possibles pour lesquelles vous voulez une " +"correspondance; cet ensemble contient des phrases en Anglais, ou des adresses " +"de courriel, ou des commandes TeX, ou tout ce que vous voulez. Vous pouvez " +"ensuite poser des questions tel que \"Est-ce que cette chaîne de caractères " +"correspond au motif ?\", ou \"Y-a-t'il une correspondance pour un motif dans le " +"chaîne de caractères ?\". Vous pouvez aussi utiliser les RE pour modifier une " +"chaîne de caractères ou la découper de différentes façons." #: ../Doc/howto/regex.rst:35 msgid "" @@ -67,6 +82,13 @@ msgid "" "requires that you have a good understanding of the matching engine's " "internals." msgstr "" +"Les motifs d'expressions régulières sont compilés en **bytecodes** qui sont " +"ensuite exécutés par un moteur de correspondance écrit en C. Pour une " +"utilisation plus poussée, il peut s'avérer nécessaire de s'intéresser à la " +"manière dont le moteur exécute la RE afin d'écrire une expression dont le " +"**bytecode** est plus rapide. L'optimisation n'est pas traitée dans ce " +"document, parce qu'elle nécessite d'avoir une bonne compréhension des " +"mécanismes internes du moteur de correspondance." #: ../Doc/howto/regex.rst:42 msgid "" @@ -78,10 +100,18 @@ msgid "" "be slower than an elaborate regular expression, it will also probably be " "more understandable." msgstr "" +"Le langage d'expressions régulières est relativement petit et restreint donc " +"toutes les tâches de manipulation de chaînes de caractères ne peuvent pas être " +"réalisées à l'aide d'expressions régulières. Il y a aussi des tâches qui " +"*peuvent* être réalisées à l'aide d'expressions régulières mais qui ont " +"tendance à produire des expressions régulières très compliquées. Dans ces cas, " +"il vous sera plus utile d'écrire du code Python pour réaliser le traitement; " +"même si le code Python sera plus lent qu'une expression régulière élaborée, il " +"sera probablement plus compréhensible." #: ../Doc/howto/regex.rst:51 msgid "Simple Patterns" -msgstr "" +msgstr "Motifs simples" #: ../Doc/howto/regex.rst:53 msgid "" @@ -89,6 +119,10 @@ msgid "" "Since regular expressions are used to operate on strings, we'll begin with " "the most common task: matching characters." msgstr "" +"Nous commencerons par étudier les expressions régulières les plus simples. Dans " +"la mesure où les expressions régulières sont utilisées pour manipuler des " +"chaînes de caractères, nous commencerons par les tâches les plus communes: la " +"correspondance de caractères ." #: ../Doc/howto/regex.rst:57 msgid "" @@ -96,10 +130,13 @@ msgid "" "expressions (deterministic and non-deterministic finite automata), you can " "refer to almost any textbook on writing compilers." msgstr "" +"Pour une explication détaillée sur la technologie sous-jacente des expressions " +"régulières (automate d'état déterministe et non-déterministe), référez-vous à " +"n'importe quel manuel sur l'écriture de compilateurs." #: ../Doc/howto/regex.rst:63 msgid "Matching Characters" -msgstr "" +msgstr "Caractères correspondants" #: ../Doc/howto/regex.rst:65 msgid "" @@ -108,6 +145,11 @@ msgid "" "can enable a case-insensitive mode that would let this RE match ``Test`` or " "``TEST`` as well; more about this later.)" msgstr "" +"La plupart des lettres ou caractères vont correspondre à eux-mêmes. Par " +"exemple, l'expression régulière ``test`` correspond à la chaîne de caractère " +"``test`` précisément. (Vous pouvez activer le mode non-sensible à la casse qui " +"permet à cette RE de correspondre à ``Test`` ou ``TEST`` également; plus à ce " +"sujet dans la suite.) " #: ../Doc/howto/regex.rst:70 msgid "" @@ -118,12 +160,20 @@ msgid "" "this document is devoted to discussing various metacharacters and what they " "do." msgstr "" +"Il y a des exceptions à cette règle; certains caractères sont des :dfn:" +"`metacharacters` spéciaux et ne correspondent pas à eux-mêmes. Au lieu de cela, " +"ils signalent que certaines choses non ordinaires doivent correspondre, ou " +"affectent d'autre portions de la RE en les répétant ou en changeant leur sens. " +"Une grande partie de ce document est consacrée au fonctionnement de ces " +"métacaractères." #: ../Doc/howto/regex.rst:76 msgid "" "Here's a complete list of the metacharacters; their meanings will be " "discussed in the rest of this HOWTO." msgstr "" +"Voici une liste complète des méta-caractères; leurs sens sera décrit dans la " +"suite de ce guide." #: ../Doc/howto/regex.rst:83 msgid "" @@ -136,6 +186,15 @@ msgid "" "characters. If you wanted to match only lowercase letters, your RE would be " "``[a-z]``." msgstr "" +"Les premiers méta-caractères que nous étudions sont ``[`` et ``]``. Ils sont " +"utilisés pour spécifier une classe de caractères, qui forme un ensemble de " +"caractères dont vous souhaitez trouver la correspondance. Les caractères " +"peuvent être listés individuellement, ou une plage de caractères peut être " +"indiquée en fournissant deux caractères séparés par un `'-'``. Par exemple, " +"``[abc]`` correspondra à n'importe quel caractère parmi ``a``, ``b``, ou ``c``; " +"ce qui est équivalent à ``[a-c]``, qui utilise une plage pour exprimer le même " +"ensemble de caractères. Si vous voulez trouver une correspondance avec " +"uniquement les lettres en minuscule, votre RE sera ``[a-z]``." #: ../Doc/howto/regex.rst:92 msgid "" @@ -144,6 +203,10 @@ msgid "" "is usually a metacharacter, but inside a character class it's stripped of " "its special nature." msgstr "" +"Les méta-caractères ne sont pas actifs dans les classes. Par exemple, ``[akm" +"$]`` correspondra à n'importe quel caractère parmi ``'a'``, ``'k'``, ``'m'``, " +"ou ``'$'``; ``'$'``est habituellement un méta-caractère mais dans une classe de " +"caractères, il est dépourvu de son caractère spécial." #: ../Doc/howto/regex.rst:97 msgid "" @@ -153,6 +216,11 @@ msgid "" "match the ``'^'`` character. For example, ``[^5]`` will match any character " "except ``'5'``." msgstr "" +"Vous pouvez trouvez une correspondance avec les caractères non listés dans une " +"classe en complimentant (:dfn:`complementing`) l'ensemble. Ceci est indiqué en " +"incluant un ``'^'`` en tant que premier caractère de la classe; ``'^'`` en " +"dehors d'une classe de caractères correspondra au caractère ``'^'``. Par " +"exemple, ``[^5]`` correspondra à tout les caractères, sauf ``[^5]``." #: ../Doc/howto/regex.rst:102 msgid "" @@ -163,6 +231,13 @@ msgid "" "need to match a ``[`` or ``\\``, you can precede them with a backslash to " "remove their special meaning: ``\\[`` or ``\\\\``." msgstr "" +"Le méta-caractère qui est probablement le plus important est le **backslash**, " +"``\\``. Comme dans les chaînes de caractères en Python, le **backslash** peut " +"être suivi par différents caractères pour signaler différentes séquences " +"spéciales. Il est aussi utilisé pour échapper tout les méta-caractères afin " +"d'en trouver les correspondances dans les motifs; par exemple, si vous devait " +"trouver une correspondance pour ``[`` ou ``\\`, vous pouvais les précéder avec " +"un **backslash** pour supprimer leur caractères spécial : ``\\[`` ou ``\\\\``." #: ../Doc/howto/regex.rst:109 msgid "" @@ -170,6 +245,10 @@ msgid "" "sets of characters that are often useful, such as the set of digits, the set " "of letters, or the set of anything that isn't whitespace." msgstr "" +"Certaines séquences spéciales commençant par ``'\\'``représentent des ensembles " +"de caractères prédéfinis qui sont souvent utiles, tels que l'ensemble des " +"chiffres, l'ensemble des lettres, ou l'ensemble des caractères qui ne sont pas " +"des séparateurs." #: ../Doc/howto/regex.rst:114 msgid "" @@ -181,6 +260,14 @@ msgid "" "in a string pattern by supplying the :const:`re.ASCII` flag when compiling " "the regular expression." msgstr "" +"Prenons un exemple: ``\\w`` correspond à n'importe quel caractères " +"alphanumérique. Si le motif **regex** est exprimé en octets, il est équivalent " +"à la classe ``[a-zA-Z0-9_]``. Si le motif **regex** est une chaîne de " +"caractères, ``\\w``correspondra à tout les caractères identifiés comme lettre " +"dans le base de données Unicode fourni par le module :mod:`unicodedata`. Vous " +"pouvez utiliser la définition plus restrictive de ``\\w`` dans un motif de " +"chaîne de caractères en spécifiant le fanion :const:`re.ASCII` lors de la " +"compilation de l'expression régulière." #: ../Doc/howto/regex.rst:122 msgid "" @@ -190,6 +277,13 @@ msgid "" "Standard Library reference. In general, the Unicode versions match any " "character that's in the appropriate category in the Unicode database." msgstr "" +"La liste de séquences spéciales suivante est incomplète. Pour une liste " +"complète de séquences et définitions de classe étendue pour des motifs de " +"chaînes de caractère s Unicode, reportez-vous à la dernière partie de la " +"référence :ref:`Syntaxe d'Expressions Régulières de la librairie " +"standard. En général, les versions d'Unicode trouve une correspondance avec " +"n'importe quel caractère présent dans le catégorie appropriée de la base de " +"données Unicode. " #: ../Doc/howto/regex.rst:130 msgid "``\\d``" @@ -198,6 +292,8 @@ msgstr "``\\d``" #: ../Doc/howto/regex.rst:130 msgid "Matches any decimal digit; this is equivalent to the class ``[0-9]``." msgstr "" +"Correspond à n'importe quel caractère numérique ; ceci est équivalent à la " +"classe ``[0-9]``." #: ../Doc/howto/regex.rst:133 msgid "``\\D``" @@ -207,6 +303,8 @@ msgstr "``\\D``" msgid "" "Matches any non-digit character; this is equivalent to the class ``[^0-9]``." msgstr "" +"Correspond à n'importe caractère non numérique; ceci est équivalent à la classe " +"``[^0-9]``." #: ../Doc/howto/regex.rst:137 msgid "``\\s``" @@ -217,6 +315,8 @@ msgid "" "Matches any whitespace character; this is equivalent to the class ``[ \\t\\n" "\\r\\f\\v]``." msgstr "" +"Correspond à n'importe caractères d'espacement; ceci est équivalent à la classe " +"``[ \\t\\n\\r\\f\\v]``." #: ../Doc/howto/regex.rst:141 msgid "``\\S``" @@ -227,6 +327,8 @@ msgid "" "Matches any non-whitespace character; this is equivalent to the class ``[^ " "\\t\\n\\r\\f\\v]``." msgstr "" +"Correspond à n'importe caractère autre que d'espacement; ceci est équivalent à " +"la classe ``[^ \\t\\n\\r\\f\\v]``." #: ../Doc/howto/regex.rst:145 msgid "``\\w``" @@ -237,6 +339,8 @@ msgid "" "Matches any alphanumeric character; this is equivalent to the class ``[a-zA-" "Z0-9_]``." msgstr "" +"Correspond à n'importe caractère alphanumérique; ceci est équivalent à la " +"classe ``[a-zA-Z0-9_]``." #: ../Doc/howto/regex.rst:149 msgid "``\\W``" @@ -247,6 +351,8 @@ msgid "" "Matches any non-alphanumeric character; this is equivalent to the class " "``[^a-zA-Z0-9_]``." msgstr "" +"Correspond à n'importe caractère non-alphanumérique; ceci est équivalent à la " +"classe ``[^a-zA-Z0-9_]``." #: ../Doc/howto/regex.rst:151 msgid "" @@ -254,6 +360,9 @@ msgid "" "``[\\s,.]`` is a character class that will match any whitespace character, " "or ``','`` or ``'.'``." msgstr "" +"Ces séquences peuvent être incluses dans une classe de caractères. Par exemple, " +"``[\\s,.]`` est une classe de caractères qui correspond à tous les caractères " +"d'espace, ou ``','`` ou ``'.'``. " #: ../Doc/howto/regex.rst:155 msgid "" @@ -262,10 +371,15 @@ msgid "" "DOTALL`) where it will match even a newline. ``.`` is often used where you " "want to match \"any character\"." msgstr "" +"Le dernier méta-caractère dans cette section est ``.``. Il correspond à tout " +"les caractères, à l'exception du caractère de retour à la ligne; il existe un " +"mode alternatif (:const:`re.DOTALL`) dans lequel il correspond également eu " +"caractère de retour à la ligne. ``.`` est souvent utilisé lorsque l'on veut " +"trouver une correspondance avec \"n'importe quel caractère\"." #: ../Doc/howto/regex.rst:162 msgid "Repeating Things" -msgstr "" +msgstr "Répetitions" #: ../Doc/howto/regex.rst:164 msgid "" @@ -305,14 +419,18 @@ msgid "" "letters from the class ``[bcd]``, and finally ends with a ``'b'``. Now " "imagine matching this RE against the string ``'abcbd'``." msgstr "" +"Un exemple étape par étape mettra les choses au clair. Considérons l'expression " +"``a[bcd]*b``. Elle correspond à la lettre ``'a'``, suivi d'aucune ou plusieurs " +"lettres de la classe `[bcd]`` et finira par un ``'b'``. Maintenant supposé que " +"cette RE correspondra à la chaîne de caractères ``'abcbd'``." #: ../Doc/howto/regex.rst:188 msgid "Step" -msgstr "" +msgstr "Etape" #: ../Doc/howto/regex.rst:188 msgid "Matched" -msgstr "" +msgstr "Correspond" #: ../Doc/howto/regex.rst:188 msgid "Explanation" @@ -328,7 +446,7 @@ msgstr "" #: ../Doc/howto/regex.rst:190 msgid "The ``a`` in the RE matches." -msgstr "" +msgstr "Le ``a`` dans la RE correspondante." #: ../Doc/howto/regex.rst:192 msgid "2" @@ -357,6 +475,8 @@ msgid "" "The engine tries to match ``b``, but the current position is at the end of " "the string, so it fails." msgstr "" +"Le moteur essaye de trouver une correspondance avec ``b`` mais la position " +"courante est à la fin de la chaîne de caractères et échoue donc." #: ../Doc/howto/regex.rst:201 msgid "4" @@ -453,7 +573,7 @@ msgstr "" #: ../Doc/howto/regex.rst:255 msgid "Using Regular Expressions" -msgstr "" +msgstr "Utilisation des Expressions Régulières" #: ../Doc/howto/regex.rst:257 msgid "" @@ -465,7 +585,7 @@ msgstr "" #: ../Doc/howto/regex.rst:264 msgid "Compiling Regular Expressions" -msgstr "" +msgstr "Compilations des Expressions Régulières" #: ../Doc/howto/regex.rst:266 msgid "" @@ -500,7 +620,7 @@ msgstr "" #: ../Doc/howto/regex.rst:295 msgid "The Backslash Plague" -msgstr "" +msgstr "Le Maudit Backslash" #: ../Doc/howto/regex.rst:297 msgid "" @@ -544,7 +664,7 @@ msgstr "" #: ../Doc/howto/regex.rst:315 msgid "Escaped backslash for :func:`re.compile`" -msgstr "" +msgstr "**backslash** échappé pour :func:`re.compile`" #: ../Doc/howto/regex.rst:317 ../Doc/howto/regex.rst:344 msgid "``\"\\\\\\\\section\"``" @@ -588,7 +708,7 @@ msgstr "" #: ../Doc/howto/regex.rst:340 msgid "Raw string" -msgstr "" +msgstr "Chaîne de caractères brute" #: ../Doc/howto/regex.rst:342 msgid "``\"ab*\"``" @@ -621,14 +741,18 @@ msgid "" "the most significant ones will be covered here; consult the :mod:`re` docs " "for a complete listing." msgstr "" +"Une fois que nous avons un objet représentant une expression régulière " +"compilée, qu'en faisons-nous ? Les objets motifs ont plusieurs méthodes et " +"attributs. Seuls les plus significatifs seront couverts ici; consultez la " +"documentation :mod:`re`pour la liste complète." #: ../Doc/howto/regex.rst:359 ../Doc/howto/regex.rst:417 -#: ../Doc/howto/regex.rst:1056 +#: ../Doc/howto/regex.rst:1054 msgid "Method/Attribute" -msgstr "" +msgstr "Méthode/Attribut" #: ../Doc/howto/regex.rst:359 ../Doc/howto/regex.rst:417 -#: ../Doc/howto/regex.rst:1056 +#: ../Doc/howto/regex.rst:1054 msgid "Purpose" msgstr "Objectif" @@ -719,7 +843,7 @@ msgstr "" #: ../Doc/howto/regex.rst:419 msgid "Return the string matched by the RE" -msgstr "" +msgstr "Retourne la chaîne de caractères correspondant à la RE" #: ../Doc/howto/regex.rst:421 msgid "``start()``" @@ -727,7 +851,7 @@ msgstr "" #: ../Doc/howto/regex.rst:421 msgid "Return the starting position of the match" -msgstr "" +msgstr "Retourne la position de début de correspondance" #: ../Doc/howto/regex.rst:423 msgid "``end()``" @@ -735,7 +859,7 @@ msgstr "" #: ../Doc/howto/regex.rst:423 msgid "Return the ending position of the match" -msgstr "" +msgstr "Retourne la position de fin de correspondance" #: ../Doc/howto/regex.rst:425 msgid "``span()``" @@ -823,7 +947,7 @@ msgstr "" #: ../Doc/howto/regex.rst:522 msgid "Compilation Flags" -msgstr "" +msgstr "Fanion de Compilation" #: ../Doc/howto/regex.rst:524 msgid "" @@ -868,6 +992,8 @@ msgstr "" #: ../Doc/howto/regex.rst:542 msgid "Make ``.`` match any character, including newlines." msgstr "" +"Fait en sorte que ``.`` corresponde à n'importe quel caractère, caractère de " +"retour à la ligne inclus." #: ../Doc/howto/regex.rst:545 msgid ":const:`IGNORECASE`, :const:`I`" @@ -875,7 +1001,7 @@ msgstr "" #: ../Doc/howto/regex.rst:545 msgid "Do case-insensitive matches." -msgstr "" +msgstr "Rechercher une correspondance non-sensible à la casse." #: ../Doc/howto/regex.rst:547 msgid ":const:`LOCALE`, :const:`L`" @@ -883,7 +1009,7 @@ msgstr "" #: ../Doc/howto/regex.rst:547 msgid "Do a locale-aware match." -msgstr "" +msgstr "Rechercher une correspondance sensible à la langue locale." #: ../Doc/howto/regex.rst:549 msgid ":const:`MULTILINE`, :const:`M`" @@ -891,7 +1017,7 @@ msgstr "" #: ../Doc/howto/regex.rst:549 msgid "Multi-line matching, affecting ``^`` and ``$``." -msgstr "" +msgstr "Correspondance multi-ligne, affectant ``^`` et ``$``." #: ../Doc/howto/regex.rst:552 msgid ":const:`VERBOSE`, :const:`X` (for 'extended')" @@ -901,6 +1027,8 @@ msgstr "" msgid "" "Enable verbose REs, which can be organized more cleanly and understandably." msgstr "" +"Activer les RE verbeuses, qui peuvent être organisées de manière plus propres " +"et compréhensibles." #: ../Doc/howto/regex.rst:561 msgid "" @@ -948,6 +1076,8 @@ msgid "" "(``^`` and ``$`` haven't been explained yet; they'll be introduced in " "section :ref:`more-metacharacters`.)" msgstr "" +"(``^`` et ``$`` n'ont pas encore été expliqués; ils seront introduit dans le " +"section :ref:`more-metacharacters`.)" #: ../Doc/howto/regex.rst:607 msgid "" @@ -1012,10 +1142,14 @@ msgid "" "this section, we'll cover some new metacharacters, and how to use groups to " "retrieve portions of the text that was matched." msgstr "" +"Jusqu'à présent nous avons seulement couvert une partie des fonctionnalités des " +"expressions régulières. Dans cette section, nous couvrirons quelques nouveaux " +"méta-caractères et comment utiliser les groupes pour récupérer des portions de " +"textes correspondante." #: ../Doc/howto/regex.rst:681 msgid "More Metacharacters" -msgstr "" +msgstr "Plus de Méta-caratères" #: ../Doc/howto/regex.rst:683 msgid "" @@ -1162,7 +1296,7 @@ msgstr "" #: ../Doc/howto/regex.rst:783 msgid "Grouping" -msgstr "" +msgstr "Regroupement" #: ../Doc/howto/regex.rst:785 msgid "" @@ -1170,17 +1304,17 @@ msgid "" "matched or not. Regular expressions are often used to dissect strings by " "writing a RE divided into several subgroups which match different components " "of interest. For example, an RFC-822 header line is divided into a header " -"name and a value, separated by a ``':'``, like this:" +"name and a value, separated by a ``':'``, like this::" msgstr "" -#: ../Doc/howto/regex.rst:798 +#: ../Doc/howto/regex.rst:796 msgid "" "This can be handled by writing a regular expression which matches an entire " "header line, and has one group which matches the header name, and another " "group which matches the header's value." msgstr "" -#: ../Doc/howto/regex.rst:802 +#: ../Doc/howto/regex.rst:800 msgid "" "Groups are marked by the ``'('``, ``')'`` metacharacters. ``'('`` and " "``')'`` have much the same meaning as they do in mathematical expressions; " @@ -1190,7 +1324,7 @@ msgid "" "repetitions of ``ab``. ::" msgstr "" -#: ../Doc/howto/regex.rst:813 +#: ../Doc/howto/regex.rst:811 msgid "" "Groups indicated with ``'('``, ``')'`` also capture the starting and ending " "index of the text that they match; this can be retrieved by passing an " @@ -1202,27 +1336,27 @@ msgid "" "they match. ::" msgstr "" -#: ../Doc/howto/regex.rst:829 +#: ../Doc/howto/regex.rst:827 msgid "" "Subgroups are numbered from left to right, from 1 upward. Groups can be " "nested; to determine the number, just count the opening parenthesis " "characters, going from left to right. ::" msgstr "" -#: ../Doc/howto/regex.rst:842 +#: ../Doc/howto/regex.rst:840 msgid "" ":meth:`~re.match.group` can be passed multiple group numbers at a time, in " "which case it will return a tuple containing the corresponding values for " "those groups. ::" msgstr "" -#: ../Doc/howto/regex.rst:848 +#: ../Doc/howto/regex.rst:846 msgid "" "The :meth:`~re.match.groups` method returns a tuple containing the strings " "for all the subgroups, from 1 up to however many there are. ::" msgstr "" -#: ../Doc/howto/regex.rst:854 +#: ../Doc/howto/regex.rst:852 msgid "" "Backreferences in a pattern allow you to specify that the contents of an " "earlier capturing group must also be found at the current location in the " @@ -1233,11 +1367,11 @@ msgid "" "when incorporating backreferences in a RE." msgstr "" -#: ../Doc/howto/regex.rst:862 +#: ../Doc/howto/regex.rst:860 msgid "For example, the following RE detects doubled words in a string. ::" msgstr "" -#: ../Doc/howto/regex.rst:868 +#: ../Doc/howto/regex.rst:866 msgid "" "Backreferences like this aren't often useful for just searching through a " "string --- there are few text formats which repeat data in this way --- but " @@ -1245,11 +1379,11 @@ msgid "" "substitutions." msgstr "" -#: ../Doc/howto/regex.rst:874 +#: ../Doc/howto/regex.rst:872 msgid "Non-capturing and Named Groups" msgstr "" -#: ../Doc/howto/regex.rst:876 +#: ../Doc/howto/regex.rst:874 msgid "" "Elaborate REs may use many groups, both to capture substrings of interest, " "and to group and structure the RE itself. In complex REs, it becomes " @@ -1258,7 +1392,7 @@ msgid "" "expression extensions, so we'll look at that first." msgstr "" -#: ../Doc/howto/regex.rst:882 +#: ../Doc/howto/regex.rst:880 msgid "" "Perl 5 is well known for its powerful additions to standard regular " "expressions. For these new features the Perl developers couldn't choose new " @@ -1269,7 +1403,7 @@ msgid "" "wouldn't have escaped it by writing ``\\&`` or ``[&]``." msgstr "" -#: ../Doc/howto/regex.rst:889 +#: ../Doc/howto/regex.rst:887 msgid "" "The solution chosen by the Perl developers was to use ``(?...)`` as the " "extension syntax. ``?`` immediately after a parenthesis was a syntax error " @@ -1280,20 +1414,20 @@ msgid "" "capturing group containing the subexpression ``foo``)." msgstr "" -#: ../Doc/howto/regex.rst:897 +#: ../Doc/howto/regex.rst:895 msgid "" "Python supports several of Perl's extensions and adds an extension syntax to " "Perl's extension syntax. If the first character after the question mark is " "a ``P``, you know that it's an extension that's specific to Python." msgstr "" -#: ../Doc/howto/regex.rst:902 +#: ../Doc/howto/regex.rst:900 msgid "" "Now that we've looked at the general extension syntax, we can return to the " "features that simplify working with groups in complex REs." msgstr "" -#: ../Doc/howto/regex.rst:905 +#: ../Doc/howto/regex.rst:903 msgid "" "Sometimes you'll want to use a group to denote a part of a regular " "expression, but aren't interested in retrieving the group's contents. You " @@ -1301,7 +1435,7 @@ msgid "" "where you can replace the ``...`` with any other regular expression. ::" msgstr "" -#: ../Doc/howto/regex.rst:917 +#: ../Doc/howto/regex.rst:915 msgid "" "Except for the fact that you can't retrieve the contents of what the group " "matched, a non-capturing group behaves exactly the same as a capturing " @@ -1314,13 +1448,13 @@ msgid "" "groups; neither form is any faster than the other." msgstr "" -#: ../Doc/howto/regex.rst:926 +#: ../Doc/howto/regex.rst:924 msgid "" "A more significant feature is named groups: instead of referring to them by " "numbers, groups can be referenced by a name." msgstr "" -#: ../Doc/howto/regex.rst:929 +#: ../Doc/howto/regex.rst:927 msgid "" "The syntax for a named group is one of the Python-specific extensions: ``(?" "P...)``. *name* is, obviously, the name of the group. Named groups " @@ -1332,20 +1466,20 @@ msgid "" "ways::" msgstr "" -#: ../Doc/howto/regex.rst:944 +#: ../Doc/howto/regex.rst:942 msgid "" "Named groups are handy because they let you use easily-remembered names, " "instead of having to remember numbers. Here's an example RE from the :mod:" "`imaplib` module::" msgstr "" -#: ../Doc/howto/regex.rst:955 +#: ../Doc/howto/regex.rst:953 msgid "" "It's obviously much easier to retrieve ``m.group('zonem')``, instead of " "having to remember to retrieve group 9." msgstr "" -#: ../Doc/howto/regex.rst:958 +#: ../Doc/howto/regex.rst:956 msgid "" "The syntax for backreferences in an expression such as ``(...)\\1`` refers " "to the number of the group. There's naturally a variant that uses the group " @@ -1356,22 +1490,22 @@ msgid "" "+(?P=word)\\b``::" msgstr "" -#: ../Doc/howto/regex.rst:971 +#: ../Doc/howto/regex.rst:969 msgid "Lookahead Assertions" msgstr "" -#: ../Doc/howto/regex.rst:973 +#: ../Doc/howto/regex.rst:971 msgid "" "Another zero-width assertion is the lookahead assertion. Lookahead " "assertions are available in both positive and negative form, and look like " "this:" msgstr "" -#: ../Doc/howto/regex.rst:981 +#: ../Doc/howto/regex.rst:979 msgid "``(?=...)``" msgstr "``(?=...)``" -#: ../Doc/howto/regex.rst:977 +#: ../Doc/howto/regex.rst:975 msgid "" "Positive lookahead assertion. This succeeds if the contained regular " "expression, represented here by ``...``, successfully matches at the current " @@ -1380,18 +1514,18 @@ msgid "" "is tried right where the assertion started." msgstr "" -#: ../Doc/howto/regex.rst:986 +#: ../Doc/howto/regex.rst:984 msgid "``(?!...)``" msgstr "``(?!...)``" -#: ../Doc/howto/regex.rst:984 +#: ../Doc/howto/regex.rst:982 msgid "" "Negative lookahead assertion. This is the opposite of the positive " "assertion; it succeeds if the contained expression *doesn't* match at the " "current position in the string." msgstr "" -#: ../Doc/howto/regex.rst:988 +#: ../Doc/howto/regex.rst:986 msgid "" "To make this concrete, let's look at a case where a lookahead is useful. " "Consider a simple pattern to match a filename and split it apart into a base " @@ -1399,15 +1533,15 @@ msgid "" "``news`` is the base name, and ``rc`` is the filename's extension." msgstr "" -#: ../Doc/howto/regex.rst:993 +#: ../Doc/howto/regex.rst:991 msgid "The pattern to match this is quite simple:" -msgstr "" +msgstr "Le motif de correspondance est plutôt simple: " -#: ../Doc/howto/regex.rst:995 +#: ../Doc/howto/regex.rst:993 msgid "``.*[.].*$``" msgstr "" -#: ../Doc/howto/regex.rst:997 +#: ../Doc/howto/regex.rst:995 msgid "" "Notice that the ``.`` needs to be treated specially because it's a " "metacharacter, so it's inside a character class to only match that specific " @@ -1417,24 +1551,24 @@ msgid "" "``printers.conf``." msgstr "" -#: ../Doc/howto/regex.rst:1004 +#: ../Doc/howto/regex.rst:1002 msgid "" "Now, consider complicating the problem a bit; what if you want to match " "filenames where the extension is not ``bat``? Some incorrect attempts:" msgstr "" -#: ../Doc/howto/regex.rst:1007 +#: ../Doc/howto/regex.rst:1005 msgid "" "``.*[.][^b].*$`` The first attempt above tries to exclude ``bat`` by " "requiring that the first character of the extension is not a ``b``. This is " "wrong, because the pattern also doesn't match ``foo.bar``." msgstr "" -#: ../Doc/howto/regex.rst:1011 +#: ../Doc/howto/regex.rst:1009 msgid "``.*[.]([^b]..|.[^a].|..[^t])$``" msgstr "" -#: ../Doc/howto/regex.rst:1013 +#: ../Doc/howto/regex.rst:1011 msgid "" "The expression gets messier when you try to patch up the first solution by " "requiring one of the following cases to match: the first character of the " @@ -1445,18 +1579,18 @@ msgid "" "pattern again in an effort to fix it." msgstr "" -#: ../Doc/howto/regex.rst:1021 +#: ../Doc/howto/regex.rst:1019 msgid "``.*[.]([^b].?.?|.[^a]?.?|..?[^t]?)$``" msgstr "" -#: ../Doc/howto/regex.rst:1023 +#: ../Doc/howto/regex.rst:1021 msgid "" "In the third attempt, the second and third letters are all made optional in " "order to allow matching extensions shorter than three characters, such as " "``sendmail.cf``." msgstr "" -#: ../Doc/howto/regex.rst:1027 +#: ../Doc/howto/regex.rst:1025 msgid "" "The pattern's getting really complicated now, which makes it hard to read " "and understand. Worse, if the problem changes and you want to exclude both " @@ -1464,11 +1598,11 @@ msgid "" "complicated and confusing." msgstr "" -#: ../Doc/howto/regex.rst:1032 +#: ../Doc/howto/regex.rst:1030 msgid "A negative lookahead cuts through all this confusion:" msgstr "" -#: ../Doc/howto/regex.rst:1034 +#: ../Doc/howto/regex.rst:1032 msgid "" "``.*[.](?!bat$)[^.]*$`` The negative lookahead means: if the expression " "``bat`` doesn't match at this point, try the rest of the pattern; if ``bat" @@ -1478,61 +1612,65 @@ msgid "" "pattern works when there are multiple dots in the filename." msgstr "" -#: ../Doc/howto/regex.rst:1041 +#: ../Doc/howto/regex.rst:1039 msgid "" "Excluding another filename extension is now easy; simply add it as an " "alternative inside the assertion. The following pattern excludes filenames " "that end in either ``bat`` or ``exe``:" msgstr "" -#: ../Doc/howto/regex.rst:1045 +#: ../Doc/howto/regex.rst:1043 msgid "``.*[.](?!bat$|exe$)[^.]*$``" msgstr "" -#: ../Doc/howto/regex.rst:1049 +#: ../Doc/howto/regex.rst:1047 msgid "Modifying Strings" msgstr "" -#: ../Doc/howto/regex.rst:1051 +#: ../Doc/howto/regex.rst:1049 msgid "" "Up to this point, we've simply performed searches against a static string. " "Regular expressions are also commonly used to modify strings in various " "ways, using the following pattern methods:" msgstr "" -#: ../Doc/howto/regex.rst:1058 +#: ../Doc/howto/regex.rst:1056 msgid "``split()``" msgstr "" -#: ../Doc/howto/regex.rst:1058 +#: ../Doc/howto/regex.rst:1056 msgid "Split the string into a list, splitting it wherever the RE matches" msgstr "" +"Découpe la chaîne de caractère en liste, la découpant partout où la RE " +"correspond" -#: ../Doc/howto/regex.rst:1061 +#: ../Doc/howto/regex.rst:1059 msgid "``sub()``" msgstr "" -#: ../Doc/howto/regex.rst:1061 +#: ../Doc/howto/regex.rst:1059 msgid "" "Find all substrings where the RE matches, and replace them with a different " "string" msgstr "" +"Rechercher toutes les sous-chaînes de caractères où correspond la RE et les " +"substituer par une chaîne de caractères différente " -#: ../Doc/howto/regex.rst:1064 +#: ../Doc/howto/regex.rst:1062 msgid "``subn()``" msgstr "" -#: ../Doc/howto/regex.rst:1064 +#: ../Doc/howto/regex.rst:1062 msgid "" "Does the same thing as :meth:`!sub`, but returns the new string and the " "number of replacements" msgstr "" -#: ../Doc/howto/regex.rst:1071 +#: ../Doc/howto/regex.rst:1069 msgid "Splitting Strings" msgstr "" -#: ../Doc/howto/regex.rst:1073 +#: ../Doc/howto/regex.rst:1071 msgid "" "The :meth:`~re.pattern.split` method of a pattern splits a string apart " "wherever the RE matches, returning a list of the pieces. It's similar to " @@ -1542,7 +1680,7 @@ msgid "" "module-level :func:`re.split` function, too." msgstr "" -#: ../Doc/howto/regex.rst:1084 +#: ../Doc/howto/regex.rst:1082 msgid "" "Split *string* by the matches of the regular expression. If capturing " "parentheses are used in the RE, then their contents will also be returned as " @@ -1550,7 +1688,7 @@ msgid "" "splits are performed." msgstr "" -#: ../Doc/howto/regex.rst:1089 +#: ../Doc/howto/regex.rst:1087 msgid "" "You can limit the number of splits made, by passing a value for *maxsplit*. " "When *maxsplit* is nonzero, at most *maxsplit* splits will be made, and the " @@ -1559,7 +1697,7 @@ msgid "" "characters. ::" msgstr "" -#: ../Doc/howto/regex.rst:1101 +#: ../Doc/howto/regex.rst:1099 msgid "" "Sometimes you're not only interested in what the text between delimiters is, " "but also need to know what the delimiter was. If capturing parentheses are " @@ -1567,17 +1705,17 @@ msgid "" "Compare the following calls::" msgstr "" -#: ../Doc/howto/regex.rst:1113 +#: ../Doc/howto/regex.rst:1111 msgid "" "The module-level function :func:`re.split` adds the RE to be used as the " "first argument, but is otherwise the same. ::" msgstr "" -#: ../Doc/howto/regex.rst:1125 +#: ../Doc/howto/regex.rst:1123 msgid "Search and Replace" -msgstr "" +msgstr "Recherche et Substitution" -#: ../Doc/howto/regex.rst:1127 +#: ../Doc/howto/regex.rst:1125 msgid "" "Another common task is to find all the matches for a pattern, and replace " "them with a different string. The :meth:`~re.pattern.sub` method takes a " @@ -1585,40 +1723,40 @@ msgid "" "string to be processed." msgstr "" -#: ../Doc/howto/regex.rst:1134 +#: ../Doc/howto/regex.rst:1132 msgid "" "Returns the string obtained by replacing the leftmost non-overlapping " "occurrences of the RE in *string* by the replacement *replacement*. If the " "pattern isn't found, *string* is returned unchanged." msgstr "" -#: ../Doc/howto/regex.rst:1138 +#: ../Doc/howto/regex.rst:1136 msgid "" "The optional argument *count* is the maximum number of pattern occurrences " "to be replaced; *count* must be a non-negative integer. The default value " "of 0 means to replace all occurrences." msgstr "" -#: ../Doc/howto/regex.rst:1142 +#: ../Doc/howto/regex.rst:1140 msgid "" "Here's a simple example of using the :meth:`~re.pattern.sub` method. It " "replaces colour names with the word ``colour``::" msgstr "" -#: ../Doc/howto/regex.rst:1151 +#: ../Doc/howto/regex.rst:1149 msgid "" "The :meth:`~re.pattern.subn` method does the same work, but returns a 2-" "tuple containing the new string value and the number of replacements that " "were performed::" msgstr "" -#: ../Doc/howto/regex.rst:1160 +#: ../Doc/howto/regex.rst:1158 msgid "" "Empty matches are replaced only when they're not adjacent to a previous " "match. ::" msgstr "" -#: ../Doc/howto/regex.rst:1167 +#: ../Doc/howto/regex.rst:1165 msgid "" "If *replacement* is a string, any backslash escapes in it are processed. " "That is, ``\\n`` is converted to a single newline character, ``\\r`` is " @@ -1629,13 +1767,13 @@ msgid "" "string." msgstr "" -#: ../Doc/howto/regex.rst:1174 +#: ../Doc/howto/regex.rst:1172 msgid "" "This example matches the word ``section`` followed by a string enclosed in " "``{``, ``}``, and changes ``section`` to ``subsection``::" msgstr "" -#: ../Doc/howto/regex.rst:1181 +#: ../Doc/howto/regex.rst:1179 msgid "" "There's also a syntax for referring to named groups as defined by the ``(?" "P...)`` syntax. ``\\g`` will use the substring matched by the " @@ -1647,7 +1785,7 @@ msgid "" "but use all three variations of the replacement string. ::" msgstr "" -#: ../Doc/howto/regex.rst:1198 +#: ../Doc/howto/regex.rst:1196 msgid "" "*replacement* can also be a function, which gives you even more control. If " "*replacement* is a function, the function is called for every non-" @@ -1656,13 +1794,13 @@ msgid "" "this information to compute the desired replacement string and return it." msgstr "" -#: ../Doc/howto/regex.rst:1204 +#: ../Doc/howto/regex.rst:1202 msgid "" "In the following example, the replacement function translates decimals into " "hexadecimal::" msgstr "" -#: ../Doc/howto/regex.rst:1216 +#: ../Doc/howto/regex.rst:1214 msgid "" "When using the module-level :func:`re.sub` function, the pattern is passed " "as the first argument. The pattern may be provided as an object or as a " @@ -1672,11 +1810,11 @@ msgid "" "x'``." msgstr "" -#: ../Doc/howto/regex.rst:1224 +#: ../Doc/howto/regex.rst:1222 msgid "Common Problems" -msgstr "" +msgstr "Problèmes courants" -#: ../Doc/howto/regex.rst:1226 +#: ../Doc/howto/regex.rst:1224 msgid "" "Regular expressions are a powerful tool for some applications, but in some " "ways their behaviour isn't intuitive and at times they don't behave the way " @@ -1684,11 +1822,11 @@ msgid "" "pitfalls." msgstr "" -#: ../Doc/howto/regex.rst:1232 +#: ../Doc/howto/regex.rst:1230 msgid "Use String Methods" msgstr "" -#: ../Doc/howto/regex.rst:1234 +#: ../Doc/howto/regex.rst:1232 msgid "" "Sometimes using the :mod:`re` module is a mistake. If you're matching a " "fixed string, or a single character class, and you're not using any :mod:" @@ -1700,7 +1838,7 @@ msgid "" "engine." msgstr "" -#: ../Doc/howto/regex.rst:1242 +#: ../Doc/howto/regex.rst:1240 msgid "" "One example might be replacing a single fixed string with another one; for " "example, you might replace ``word`` with ``deed``. :func:`re.sub` seems " @@ -1713,7 +1851,7 @@ msgid "" "meth:`!replace`'s abilities.)" msgstr "" -#: ../Doc/howto/regex.rst:1251 +#: ../Doc/howto/regex.rst:1249 msgid "" "Another common task is deleting every occurrence of a single character from " "a string or replacing it with another single character. You might do this " @@ -1722,17 +1860,17 @@ msgid "" "operation can be." msgstr "" -#: ../Doc/howto/regex.rst:1257 +#: ../Doc/howto/regex.rst:1255 msgid "" "In short, before turning to the :mod:`re` module, consider whether your " "problem can be solved with a faster and simpler string method." msgstr "" -#: ../Doc/howto/regex.rst:1262 +#: ../Doc/howto/regex.rst:1260 msgid "match() versus search()" msgstr "" -#: ../Doc/howto/regex.rst:1264 +#: ../Doc/howto/regex.rst:1262 msgid "" "The :func:`~re.match` function only checks if the RE matches at the " "beginning of the string while :func:`~re.search` will scan forward through " @@ -1742,13 +1880,13 @@ msgid "" "report it. ::" msgstr "" -#: ../Doc/howto/regex.rst:1275 +#: ../Doc/howto/regex.rst:1273 msgid "" "On the other hand, :func:`~re.search` will scan forward through the string, " "reporting the first match it finds. ::" msgstr "" -#: ../Doc/howto/regex.rst:1283 +#: ../Doc/howto/regex.rst:1281 msgid "" "Sometimes you'll be tempted to keep using :func:`re.match`, and just add ``." "*`` to the front of your RE. Resist this temptation and use :func:`re." @@ -1760,18 +1898,18 @@ msgid "" "starting character, only trying the full match if a ``'C'`` is found." msgstr "" -#: ../Doc/howto/regex.rst:1292 +#: ../Doc/howto/regex.rst:1290 msgid "" "Adding ``.*`` defeats this optimization, requiring scanning to the end of " "the string and then backtracking to find a match for the rest of the RE. " "Use :func:`re.search` instead." msgstr "" -#: ../Doc/howto/regex.rst:1298 +#: ../Doc/howto/regex.rst:1296 msgid "Greedy versus Non-Greedy" msgstr "" -#: ../Doc/howto/regex.rst:1300 +#: ../Doc/howto/regex.rst:1298 msgid "" "When repeating a regular expression, as in ``a*``, the resulting action is " "to consume as much of the pattern as possible. This fact often bites you " @@ -1780,7 +1918,7 @@ msgid "" "HTML tag doesn't work because of the greedy nature of ``.*``. ::" msgstr "" -#: ../Doc/howto/regex.rst:1314 +#: ../Doc/howto/regex.rst:1312 msgid "" "The RE matches the ``'<'`` in ``''``, and the ``.*`` consumes the rest " "of the string. There's still more left in the RE, though, and the ``>`` " @@ -1790,7 +1928,7 @@ msgid "" "``''``, which isn't what you want." msgstr "" -#: ../Doc/howto/regex.rst:1321 +#: ../Doc/howto/regex.rst:1319 msgid "" "In this case, the solution is to use the non-greedy qualifiers ``*?``, ``+?" "``, ``??``, or ``{m,n}?``, which match as *little* text as possible. In the " @@ -1799,7 +1937,7 @@ msgid "" "retrying the ``'>'`` at every step. This produces just the right result::" msgstr "" -#: ../Doc/howto/regex.rst:1330 +#: ../Doc/howto/regex.rst:1328 msgid "" "(Note that parsing HTML or XML with regular expressions is painful. Quick-" "and-dirty patterns will handle common cases, but HTML and XML have special " @@ -1809,11 +1947,11 @@ msgid "" "such tasks.)" msgstr "" -#: ../Doc/howto/regex.rst:1338 +#: ../Doc/howto/regex.rst:1336 msgid "Using re.VERBOSE" -msgstr "" +msgstr "Utilisez re.VERBOSE" -#: ../Doc/howto/regex.rst:1340 +#: ../Doc/howto/regex.rst:1338 msgid "" "By now you've probably noticed that regular expressions are a very compact " "notation, but they're not terribly readable. REs of moderate complexity can " @@ -1821,14 +1959,14 @@ msgid "" "making them difficult to read and understand." msgstr "" -#: ../Doc/howto/regex.rst:1345 +#: ../Doc/howto/regex.rst:1343 msgid "" "For such REs, specifying the :const:`re.VERBOSE` flag when compiling the " "regular expression can be helpful, because it allows you to format the " "regular expression more clearly." msgstr "" -#: ../Doc/howto/regex.rst:1349 +#: ../Doc/howto/regex.rst:1347 msgid "" "The ``re.VERBOSE`` flag has several effects. Whitespace in the regular " "expression that *isn't* inside a character class is ignored. This means " @@ -1839,23 +1977,27 @@ msgid "" "quoted strings, this enables REs to be formatted more neatly::" msgstr "" -#: ../Doc/howto/regex.rst:1366 +#: ../Doc/howto/regex.rst:1364 msgid "This is far more readable than::" -msgstr "" +msgstr "Ceci est beaucoup plus lisible que::" + +#: ../Doc/howto/regex.rst:1370 +msgid "Feedback" +msgstr "Retour" #: ../Doc/howto/regex.rst:1372 -msgid "Feedback" -msgstr "" - -#: ../Doc/howto/regex.rst:1374 msgid "" "Regular expressions are a complicated topic. Did this document help you " "understand them? Were there parts that were unclear, or Problems you " "encountered that weren't covered here? If so, please send suggestions for " "improvements to the author." msgstr "" +"Les expressions régulières sont un sujet compliqué. Est-ce que ce document vous " +"a aidé à les comprendre ? Des parties ne sont pas claires, ou des problèmes que " +"vous avez rencontrés ne sont pas traités ici ? Si tel est le cas, merci " +"d'envoyer vos suggestions d'améliorations à l'auteur." -#: ../Doc/howto/regex.rst:1379 +#: ../Doc/howto/regex.rst:1377 msgid "" "The most complete book on regular expressions is almost certainly Jeffrey " "Friedl's Mastering Regular Expressions, published by O'Reilly. " @@ -1865,3 +2007,10 @@ msgid "" "edition covered Python's now-removed :mod:`!regex` module, which won't help " "you much.) Consider checking it out from your library." msgstr "" +"Le livre le plus complet sur les expressions régulières est certainement " +"Mastering Regular Expressions de Jeffrey Friedl, publié par O'Reilly. " +"Malheureusement, il se concentre sur les déclinaisons Perl et Java des " +"expressions régulières et ne contient aucun contenu pour Python; il n'est donc " +"pas utile d'en faire référence pour la programmation Python. (La première " +"édition traitée du module Python:mod:`!regex`, maintenant supprimé, ce qui ne " +"vous aidera pas beaucoup.) Pensez à le retirer de votre bibliothèque."