cvs: phpdoc-pt_BR /reference/regex reference.xml
| From: | Alessander Pery Lopes Thomaz | Date: | Mon, 28 Apr 2003 05:25:07 +0000 |
| Subject: | cvs: phpdoc-pt_BR /reference/regex reference.xml | ||
| Groups: | php.doc.pt-br | ||
| Request: | Send a blank email to doc-pt-br+get-797@lists.php.net to get a copy of this message | ||
kappu Mon Apr 28 01:25:07 2003 EDT
Added files:
/phpdoc-pt_BR/reference/regex reference.xml
Log:
translate
Index: phpdoc-pt_BR/reference/regex/reference.xml
+++ phpdoc-pt_BR/reference/regex/reference.xml
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- EN-Revision: 1.4 Maintainer: kappu Status: ready -->
<reference id="ref.regex">
<title>Funções de Expressões Regulares (Compatíveis com o padrão POSIX)</title>
<titleabbrev>Regexps</titleabbrev>
<partintro>
<section id="regex.intro">
&reftitle.intro;
<note>
<para>
PHP também suporta expressões regulares compatatíveis com a sintaxe do PERL
usando as <link linkend="ref.pcre">Funções PCRE</link>. Essas
funções
suportam quantificadores não gulosos, assertions, conditional subpatterns, e várias
outras características que não são suportadas pelas Expressões Regulares
compatíveis com o padrão POSIX.
</para>
</note>
<warning>
<para>
Essas expressões regulares não são seguro para dados binários. As
linkend="ref.pcre">Funções PCRE</link> são.
</para>
</warning>
<para>
Expressões regulares são usadas para manipulações complexas de strings
no PHP. As funções suportadas pelas expressões regulares são:
<itemizedlist>
<listitem>
<simpara><function>ereg</function></simpara>
</listitem>
<listitem>
<simpara><function>ereg_replace</function></simpara>
</listitem>
<listitem>
<simpara><function>eregi</function></simpara>
</listitem>
<listitem>
<simpara><function>eregi_replace</function></simpara>
</listitem>
<listitem>
<simpara><function>split</function></simpara>
</listitem>
<listitem>
<simpara><function>spliti</function></simpara>
</listitem>
</itemizedlist>
Em todas funções coloque a string da expressão regular no
primeiro argumento. PHP suporta expressões regulares compatíveis com POSIX
definidas pelo POSIX 1003.2. Para um descrição completa das expressões
regulares no POSIX veja as man pages sobre regex incluídas no diretório regex
de sua distribuição PHP. Utilizando o comando <command>man
/usr/local/src/regex/regex.7</command>.
</para>
</section>
<section id="regex.requirements">
&reftitle.required;
&no.requirement;
</section>
<section id="regex.installation">
&reftitle.install;
&no.install;
</section>
<section id="regex.configuration">
&reftitle.runtime;
&no.config;
</section>
<section id="regex.resources">
&reftitle.resources;
&no.resource;
</section>
<section id="regex.constants">
&reftitle.constants;
&no.constants;
</section>
<section id="regex.examples">
&reftitle.examples;
<para>
<example>
<title>Exemplos de Expressões Regulares</title>
<programlisting role="php">
<![CDATA[
ereg ("abc", $string);
/* Retorna true se "abc"
existir em qualquer lugar de $string. */
ereg ("^abc", $string);
/* Retorna true se "abc";
existir no início de $string. */
ereg ("abc$", $string);
/* Retorna true se "abc"
existir no final de $string. */
eregi ("(ozilla.[23]|MSIE.3)", $HTTP_USER_AGENT);
/* Retorna true se o navegador do cliente
for Netscape 2, 3 ou MSIE 3. */
ereg ("([[:alnum:]]+) ([[:alnum:]]+) ([[:alnum:]]+)", $string,$regs);
/* Adiciona três palavras separadas por espaço
em $regs[1], $regs[2] e $regs[3]. */
$string = ereg_replace ("^", "<br />", $string);
/* Acrescenta a tag <br /> no início de $string. */
$string = ereg_replace ("$", "<br />", $string);
/* Acrescenta a tag <br />; no final de $string. */
$string = ereg_replace ("\n", "", $string);
/* Remove todos caracteres de nova linha (newline)
em $string. */
]]>
</programlisting>
</example>
</para>
</section>
<section id="regex.seealso">
&reftitle.seealso;
<para>
Para expressões regulares compatatíveis com a sintaxe do PERL olhe as
<link linkend="ref.pcre">Funções PCRE</link>.
</para>
</section>
</partintro>
&reference.regex.functions;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->