cvs: /phpdoc/functions pcre.sgml strings.sgml
| From: | Andrey Zmievski | Date: | Sat, 17 Jul 1999 15:42:52 +0000 |
| Subject: | cvs: /phpdoc/functions pcre.sgml strings.sgml | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-8655@lists.php.net to get a copy of this message | ||
andrey Sat Jul 17 15:42:52 1999 EDT
Modified files:
/phpdoc/functions pcre.sgml strings.sgml
Log:
-Documented preg_grep() function
-Corrected prototype of quotemeta()
Index: phpdoc/functions/pcre.sgml
diff -u phpdoc/functions/pcre.sgml:1.3 phpdoc/functions/pcre.sgml:1.4
--- phpdoc/functions/pcre.sgml:1.3 Sat Jun 19 23:04:56 1999
+++ phpdoc/functions/pcre.sgml Sat Jul 17 15:42:51 1999
@@ -303,6 +303,69 @@
</refsect1>
</refentry>
+ <refentry id="function.preg-quote">
+ <refnamediv>
+ <refname>preg_quote</refname>
+ <refpurpose>Quote regular expression characters</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>string <function>preg_quote</function></funcdef>
+ <paramdef>string <parameter>str</parameter></paramdef>
+ </funcsynopsis>
+
+ <para>
+ <function>preg_quote</function> takes <parameter>str</parameter>
+ and puts a backslash in front of every character that is part of
+ the regular expression syntax. This is useful if you have a
+ run-time string that you need to match in some text and the
+ string may contain special regex characters.
+
+ <para>
+ The special regular expression characters are:
+ <screen>. \\ + * ? [ ^ ] $ ( ) { } = ! < > | :</screen>
+
+ <note>
+ <para>
+ This function was added in PHP 3.0.9.
+ </note>
+ </refsect1>
+ </refentry>
+
+ <refentry id="function.preg-grep">
+ <refnamediv>
+ <refname>preg_grep</refname>
+ <refpurpose>Return array entries that match the pattern</refpurpose>
+ </refnamediv>
+ <refsect1>
+ <title>Description</title>
+ <funcsynopsis>
+ <funcdef>array <function>preg_grep</function></funcdef>
+ <paramdef>string <parameter>pattern</parameter></paramdef>
+ <paramdef>array <parameter>input</parameter></paramdef>
+ </funcsynopsis>
+
+ <para>
+ <function>preg_grep</function> returns the array consisting of
+ the elements of the <parameter>input</parameter> array that match
+ the given <parameter>pattern</parameter>.
+
+ <para>
+ <example>
+ <title><function>preg_grep</function> example</title>
+ <programlisting>
+preg_grep("/^(\d+)?\.\d+$/", $array); // find all floating point numbers in the array
+ </programlisting>
+ </example>
+
+ <note>
+ <para>
+ This function was added in PHP 4.0.
+ </note>
+ </refsect1>
+ </refentry>
+
<refentry id="pcre.pattern.options">
<refnamediv>
<refname>Pattern Options</refname>
Index: phpdoc/functions/strings.sgml
diff -u phpdoc/functions/strings.sgml:1.6 phpdoc/functions/strings.sgml:1.7
--- phpdoc/functions/strings.sgml:1.6 Mon Jun 21 18:16:42 1999
+++ phpdoc/functions/strings.sgml Sat Jul 17 15:42:51 1999
@@ -692,7 +692,7 @@
<refsect1>
<title>Description</title>
<funcsynopsis>
- <funcdef>int <function>quotemeta</function></funcdef>
+ <funcdef>string <function>quotemeta</function></funcdef>
<paramdef>string <parameter>str</parameter></paramdef>
</funcsynopsis>
<para>