From: Ævar Arnfjörð Bjarmason Date: Sun, 8 Jan 2006 05:35:03 +0000 (+0000) Subject: * Add a getRegexCase() accessor for getting i or nothing depending on the X-Git-Tag: 1.6.0~698 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/Main?a=commitdiff_plain;h=2ffee5ab5b3beb58d856e98f4bfb0bad02957c5a;p=lhc%2Fweb%2Fwiklou.git * Add a getRegexCase() accessor for getting i or nothing depending on the case-insensitiveness of the thing, only needed with getBaseRegex() since that won't include it automatically.. --- diff --git a/includes/MagicWord.php b/includes/MagicWord.php index 87a332bfc9..2c091654f8 100644 --- a/includes/MagicWord.php +++ b/includes/MagicWord.php @@ -198,6 +198,18 @@ class MagicWord { return $this->mRegex; } + /** + * Gets the regexp case modifier to use, i.e. i or nothing, to be used if + * one is using MagicWord::getBaseRegex(), otherwise it'll be included in + * the complete expression + */ + function getRegexCase() { + if ( $this->mRegex === '' ) + $this->initRegex(); + + return $this->mCaseSensitive ? '' : 'i'; + } + /** * Gets a regex matching the word, if it is at the string start */