diff options
Diffstat (limited to 'buildscripts/phing/classes/phing/util/regexp/Regexp.php')
-rwxr-xr-x[-rw-r--r--] | buildscripts/phing/classes/phing/util/regexp/Regexp.php | 45 |
1 files changed, 40 insertions, 5 deletions
diff --git a/buildscripts/phing/classes/phing/util/regexp/Regexp.php b/buildscripts/phing/classes/phing/util/regexp/Regexp.php index 68c06668..7188997e 100644..100755 --- a/buildscripts/phing/classes/phing/util/regexp/Regexp.php +++ b/buildscripts/phing/classes/phing/util/regexp/Regexp.php @@ -1,6 +1,6 @@ <?php /* - * $Id: Regexp.php,v 1.5 2003/12/24 18:40:33 hlellelid Exp $ + * $Id: b669eb9f2dd8533cba67b2058b7cbc2f558bdeae $ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -23,7 +23,7 @@ * A factory class for regex functions. * @author Hans Lellelid <hans@xmpl.org> * @package phing.util.regexp - * @version $Revision: 1.5 $ + * @version $Id$ */ class Regexp { @@ -97,12 +97,11 @@ class Regexp { /** * Gets replacement string. * @return string The pattern to replace matches with. - * @return void */ public function getReplace() { return $this->replace; } - + /** * Performs match of specified pattern against $subject. * @param string $subject The subject, on which to perform matches. @@ -146,6 +145,27 @@ class Regexp { } return $this->groups[$idx]; } + + /** + * Sets pattern modifiers for regex engine + * + * @param string $mods Modifiers to be applied to a given regex + * @return void + */ + public function setModifiers($mods) { + $this->engine->setModifiers($mods); + } + + /** + * Gets pattern modifiers. + * Subsequent call to engines getModifiers() filters out duplicates + * i.e. if i is provided in $mods, and setIgnoreCase(true), "i" + * modifier would be included only once + * @return string + */ + public function getModifiers() { + return $this->engine->getModifiers(); + } /** * Sets whether the regexp matching is case insensitive. @@ -163,6 +183,21 @@ class Regexp { function getIgnoreCase() { return $this->engine->getIgnoreCase(); } + + /** + * Sets whether regexp should be applied in multiline mode. + * @param boolean $bit + */ + function setMultiline($bit) { + $this->engine->setMultiline($bit); + } + + /** + * Gets whether regexp is to be applied in multiline mode. + * @return boolean + */ + function getMultiline() { + return $this->engine->getMultiline(); + } } -?>
\ No newline at end of file |