From 2ffee5ab5b3beb58d856e98f4bfb0bad02957c5a Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Sun, 8 Jan 2006 05:35:03 +0000 Subject: [PATCH] * 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.. --- includes/MagicWord.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 */ -- 2.20.1