protected function _replaceCurrency($str) {
		if (!preg_match_all('/\[currency(.*?)\](.*)\[\/currency\]/i', $str, $matches)) {
			// Fallback regex for when no options are passed.
			if (!preg_match_all('/\[currency(.*?)\](.[^\[]*)\[\/currency\]/i', $str, $matches)) {
				return $str;
			}
		}

		foreach ($matches[0] as $i => $find) {
			$opts = $this->_extractAttributes(trim($matches[1][$i]));

			$currency = CakeNumber::defaultCurrency();
			if (isset($opts['currency'])) {
				$currency = $opts['currency'];
				unset($opts['currency']);
			}

			$replace = (empty($matches[2][$i]) || !is_numeric($matches[2][$i])) ? '' : CakeNumber::currency($matches[2][$i], $currency, $opts);
			$str = str_replace($find, $replace, $str);
		}

		return $str;
	}