home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / xampp-win32-1.6.7-installer.exe / php / PEAR / Text / Wiki / Parse / Default / Horiz.php < prev    next >
Encoding:
PHP Script  |  2008-07-02  |  1.2 KB  |  70 lines

  1. <?php
  2.  
  3. /**
  4. * Parses for horizontal ruling lines.
  5. * @category Text
  6. * @package Text_Wiki
  7. * @author Paul M. Jones <pmjones@php.net>
  8. * @license LGPL
  9. * @version $Id: Horiz.php,v 1.3 2005/02/23 17:38:29 pmjones Exp $
  10. */
  11.  
  12. /**
  13. * Parses for horizontal ruling lines.
  14. * This class implements a Text_Wiki_Parse to find source text marked to
  15. * be a horizontal rule, as defined by four dashed on their own line.
  16. *
  17. * @category Text
  18. * @package Text_Wiki
  19. * @author Paul M. Jones <pmjones@php.net>
  20. */
  21.  
  22. class Text_Wiki_Parse_Horiz extends Text_Wiki_Parse {
  23.     
  24.     
  25.     /**
  26.     * 
  27.     * The regular expression used to parse the source text and find
  28.     * matches conforming to this rule.  Used by the parse() method.
  29.     * 
  30.     * @access public
  31.     * 
  32.     * @var string
  33.     * 
  34.     * @see parse()
  35.     * 
  36.     */
  37.     
  38.     var $regex = '/^([-]{4,})$/m';
  39.     
  40.     
  41.     /**
  42.     * 
  43.     * Generates a replacement token for the matched text.
  44.     * 
  45.     * @access public
  46.     *
  47.     * @param array &$matches The array of matches from parse().
  48.     *
  49.     * @return string A token marking the horizontal rule.
  50.     *
  51.     */
  52.     
  53.     function process(&$matches)
  54.     {    
  55.         return $this->wiki->addToken($this->rule);
  56.     }
  57. }
  58. ?>