@@ -2388,11 +2388,14 @@ msgid ""
23882388"if match:\n"
23892389" process(match)"
23902390msgstr ""
2391+ "correspondencia = re.search(padrao, string)\n"
2392+ "if correspondencia:\n"
2393+ " processa(correspondencia)"
23912394
23922395#: ../../library/re.rst:1366
23932396msgid "Match object returned by successful ``match``\\ es and ``search``\\ es."
23942397msgstr ""
2395- "Objetode correspondência retornado por ``match``\\ s e ``search``\\ s bem "
2398+ "Objeto correspondência retornado por ``match``\\ s e ``search``\\ s bem "
23962399"sucedidos."
23972400
23982401#: ../../library/re.rst:1368
@@ -2459,6 +2462,15 @@ msgid ""
24592462">>> m.group(1, 2) # Multiple arguments give us a tuple.\n"
24602463"('Isaac', 'Newton')"
24612464msgstr ""
2465+ ">>> m = re.match(r\" (\\ w+) (\\ w+)\" ,\" Isaac Newton, físico\" )\n"
2466+ ">>> m.group(0) # A correspondência inteira\n"
2467+ "'Isaac Newton'\n"
2468+ ">>> m.group(1) # O primeira subgrupo entre parênteses.\n"
2469+ "'Isaac'\n"
2470+ ">>> m.group(2) # O segundo subgrupo entre parênteses.\n"
2471+ "'Newton'\n"
2472+ ">>> m.group(1, 2) # Múltiplos argumentos retornam uma tupla.\n"
2473+ "('Isaac', 'Newton')"
24622474
24632475#: ../../library/re.rst:1409
24642476msgid ""
@@ -2467,7 +2479,7 @@ msgid ""
24672479"string argument is not used as a group name in the pattern, an :exc:"
24682480"`IndexError` exception is raised."
24692481msgstr ""
2470- "Se a expressão regular usa a sintaxe ``(?P<name >...)``, os argumentos "
2482+ "Se a expressão regular usa a sintaxe ``(?P<nome >...)``, os argumentos "
24712483"*groupN* também podem ser strings que identificam grupos por seus nomes de "
24722484"grupo. Se um argumento string não for usado como um nome de grupo no padrão, "
24732485"uma exceção :exc:`IndexError` é levantada."
@@ -2485,6 +2497,12 @@ msgid ""
24852497">>> m.group('last_name')\n"
24862498"'Reynolds'"
24872499msgstr ""
2500+ ">>> m = re.match(r\" (?P<primeiro_nome>\\ w+) (?P<ultimo_nome>\\ w+)\" , "
2501+ "\" Malcolm Reynolds\" )\n"
2502+ ">>> m.group('primeiro_nome')\n"
2503+ "'Malcolm'\n"
2504+ ">>> m.group('ultimo_nome')\n"
2505+ "'Reynolds'"
24882506
24892507#: ../../library/re.rst:1422
24902508msgid "Named groups can also be referred to by their index::"
@@ -2497,6 +2515,10 @@ msgid ""
24972515">>> m.group(2)\n"
24982516"'Reynolds'"
24992517msgstr ""
2518+ ">>> m.group(1)\n"
2519+ "'Malcolm'\n"
2520+ ">>> m.group(2)\n"
2521+ "'Reynolds'"
25002522
25012523#: ../../library/re.rst:1429
25022524msgid "If a group matches multiple times, only the last match is accessible::"
@@ -2510,6 +2532,10 @@ msgid ""
25102532">>> m.group(1) # Returns only the last match.\n"
25112533"'c3'"
25122534msgstr ""
2535+ ">>> m = re.match(r\" (..)+\" ,\" a1b2c3\" ) # Corresponde 3 vezes.\n"
2536+ ">>> m.group(1) # Retorna somente a última "
2537+ "correspondência.\n"
2538+ "'c3'"
25132539
25142540#: ../../library/re.rst:1438
25152541msgid ""
@@ -2529,10 +2555,17 @@ msgid ""
25292555">>> m[2] # The second parenthesized subgroup.\n"
25302556"'Newton'"
25312557msgstr ""
2558+ ">>> m = re.match(r\" (\\ w+) (\\ w+)\" ,\" Isaac Newton, físico\" )\n"
2559+ ">>> m[0] # A correspondência inteira'\n"
2560+ "Isaac Newton'\n"
2561+ ">>> m[1] # O primeiro subgrupo entre parênteses.\n"
2562+ "'Isaac'\n"
2563+ ">>> m[2] # O segundo subgrupo entre parênteses.\n"
2564+ "'Newton'"
25322565
25332566#: ../../library/re.rst:1449
25342567msgid "Named groups are supported as well::"
2535- msgstr "Grupos nomeados também são suportados ::"
2568+ msgstr "Também há suporte para grupos nomeados ::"
25362569
25372570#: ../../library/re.rst:1451
25382571msgid ""
@@ -2543,6 +2576,12 @@ msgid ""
25432576">>> m['last_name']\n"
25442577"'Newton'"
25452578msgstr ""
2579+ ">>> m = re.match(r\" (?P<primeiro_nome>\\ w+) (?P<segundo_nome>\\ w+)\" , "
2580+ "\" Isaac Newton\" )\n"
2581+ ">>> m['primeiro_nome']\n"
2582+ "'Isaac'\n"
2583+ ">>> m['segundo_nome']\n"
2584+ "'Newton'"
25462585
25472586#: ../../library/re.rst:1462
25482587msgid ""
@@ -2564,6 +2603,9 @@ msgid ""
25642603">>> m.groups()\n"
25652604"('24', '1632')"
25662605msgstr ""
2606+ ">>> m = re.match(r\" (\\ d+)\\ .(\\ d+)\" ,\" 24.1632\" )\n"
2607+ ">>> m.groups()\n"
2608+ "('24', '1632')"
25672609
25682610#: ../../library/re.rst:1472
25692611msgid ""
@@ -2583,6 +2625,11 @@ msgid ""
25832625">>> m.groups('0') # Now, the second group defaults to '0'.\n"
25842626"('24', '0')"
25852627msgstr ""
2628+ ">>> m = re.match(r\" (\\ d+)\\ .?(\\ d+)?\" ,\" 24\" )\n"
2629+ ">>> m.groups() # Segundo grupo padronizado para None.\n"
2630+ "('24', None)\n"
2631+ ">>> m.groups('0') # Agora, o segundo grupo é padronizado para '0'.\n"
2632+ "('24', '0')"
25862633
25872634#: ../../library/re.rst:1485
25882635msgid ""
@@ -2602,6 +2649,10 @@ msgid ""
26022649">>> m.groupdict()\n"
26032650"{'first_name': 'Malcolm', 'last_name': 'Reynolds'}"
26042651msgstr ""
2652+ ">>> m = re.match(r\" (?P<primeiro_nome>\\ w+) (?P<segundo_nome>\\ w+)\" , "
2653+ "\" Malcolm Reynolds\" )\n"
2654+ ">>> m.groupdict()\n"
2655+ "{'primeiro_nome': 'Malcolm', 'segundo_nome': 'Reynolds'}"
26052656
26062657#: ../../library/re.rst:1497
26072658msgid ""
@@ -2620,7 +2671,7 @@ msgstr ""
26202671
26212672#: ../../library/re.rst:1503
26222673msgid "m.string[m.start(g):m.end(g)]"
2623- msgstr ""
2674+ msgstr "m.string[m.start(g):m.end(g)] "
26242675
26252676#: ../../library/re.rst:1505
26262677msgid ""
@@ -2636,7 +2687,7 @@ msgstr ""
26362687
26372688#: ../../library/re.rst:1510
26382689msgid "An example that will remove *remove_this* from email addresses::"
2639- msgstr "Um exemplo que removerá *remove_this * dos endereços de e-mail::"
2690+ msgstr "Um exemplo que removerá *remova_isto * dos endereços de e-mail::"
26402691
26412692#: ../../library/re.rst:1512
26422693msgid ""
@@ -2645,16 +2696,21 @@ msgid ""
26452696">>> email[:m.start()] + email[m.end():]\n"
26462697"'tony@tiger.net'"
26472698msgstr ""
2699+ ">>> email =\" tony@tiremova_istoger.net\" \n"
2700+ ">>> m = re.search(\" remova_isto\" , email)\n"
2701+ ">>> email[:m.start()] + email[m.end():]\n"
2702+ "'tony@tiger.net'"
26482703
26492704#: ../../library/re.rst:1520
26502705msgid ""
26512706"For a match *m*, return the 2-tuple ``(m.start(group), m.end(group))``. Note "
26522707"that if *group* did not contribute to the match, this is ``(-1, -1)``. "
26532708"*group* defaults to zero, the entire match."
26542709msgstr ""
2655- "Para uma correspondência *m*, retorna a tupla de dois ``(m.start(group), m."
2656- "end(group))``. Observe que se *group* não contribuiu para a correspondência, "
2657- "isso é ``(-1, -1)``. *group* tem como padrão zero, a correspondência inteira."
2710+ "Para uma correspondência *m*, retorna a tupla com dois elementos ``(m."
2711+ "start(group), m.end(group))``. Observe que se *group* não contribuiu para a "
2712+ "correspondência, isso é ``(-1, -1)``. *group* tem como padrão zero, a "
2713+ "correspondência inteira."
26582714
26592715#: ../../library/re.rst:1527
26602716msgid ""
@@ -2663,8 +2719,8 @@ msgid ""
26632719"index into the string at which the RE engine started looking for a match."
26642720msgstr ""
26652721"O valor de *pos* que foi passado para o método :meth:`~Pattern.search` ou :"
2666- "meth:`~Pattern.match` de um :ref:`objetode regex <re-objects>`. Este é o "
2667- "índice da string na qual o mecanismo de ER começou a procurar uma "
2722+ "meth:`~Pattern.match` de um :ref:`objetoexpressão regular <re-objects>`. "
2723+ "Este é o índice da string na qual o mecanismo de ER começou a procurar uma "
26682724"correspondência."
26692725
26702726#: ../../library/re.rst:1534
@@ -2674,8 +2730,9 @@ msgid ""
26742730"the index into the string beyond which the RE engine will not go."
26752731msgstr ""
26762732"O valor de *endpos* que foi passado para o método :meth:`~Pattern.search` "
2677- "ou :meth:`~Pattern.match` de um :ref:`objeto de regex <re-objects>`. Este é "
2678- "o índice da string após o qual o mecanismo de ER não vai chegar."
2733+ "ou :meth:`~Pattern.match` de um :ref:`objeto expressão regular <re-"
2734+ "objects>`. Este é o índice da string após o qual o mecanismo de ER não vai "
2735+ "chegar."
26792736
26802737#: ../../library/re.rst:1541
26812738msgid ""
@@ -2717,7 +2774,7 @@ msgid ""
27172774"Added support of :func:`copy.copy` and :func:`copy.deepcopy`. Match objects "
27182775"are considered atomic."
27192776msgstr ""
2720- "Adicionado suportede :func:`copy.copy` e :func:`copy.deepcopy`. Objetos "
2777+ "Adicionado suportepara :func:`copy.copy` e :func:`copy.deepcopy`. Objetos "
27212778"correspondência são considerados atômicos."
27222779
27232780#: ../../library/re.rst:1573