[PHP-DOC] cvs: phpdoc /en/functions pcre.xml From: Monte Ohrt (monte <email protected>)
Date: 07/20/00

mohrt Thu Jul 20 10:20:20 2000 EDT

  Modified files:
    /phpdoc/en/functions pcre.xml
  Log:
  added example to preg_match() documentation
  
  
Index: phpdoc/en/functions/pcre.xml
diff -u phpdoc/en/functions/pcre.xml:1.8 phpdoc/en/functions/pcre.xml:1.9
--- phpdoc/en/functions/pcre.xml:1.8 Wed Jul 19 08:02:02 2000
+++ phpdoc/en/functions/pcre.xml Thu Jul 20 10:20:20 2000
@@ -99,6 +99,14 @@
 }
       </programlisting>
      </example>
+ <example>
+ <title>Getting the domain name out of a URL</title>
+ <programlisting role="php">
+ preg_match("/^(.*)([^\.]+\.[^\.]+)(\/.*)?/U",
+"http://www.php.net/index.html", $matches);
+ echo "domain name is: ".$matches[2]."\n";
+ </programlisting>
+ </example>
      See also <function>preg_match_all</function>,
      <function>preg_replace</function>, and
      <function>preg_split</function>.