|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r79633 - website/public_html/beta/common/code
From: dnljms_at_[hidden]
Date: 2012-07-21 03:18:39
Author: danieljames
Date: 2012-07-21 03:18:39 EDT (Sat, 21 Jul 2012)
New Revision: 79633
URL: http://svn.boost.org/trac/boost/changeset/79633
Log:
Website: Move _preg_replace_bounds to the only file that it's used in.
Text files modified:
website/public_html/beta/common/code/boost_filter_boost_libs.php | 28 ++++++++++++++++++++++++++++
website/public_html/beta/common/code/boost_utility.php | 30 ------------------------------
2 files changed, 28 insertions(+), 30 deletions(-)
Modified: website/public_html/beta/common/code/boost_filter_boost_libs.php
==============================================================================
--- website/public_html/beta/common/code/boost_filter_boost_libs.php (original)
+++ website/public_html/beta/common/code/boost_filter_boost_libs.php 2012-07-21 03:18:39 EDT (Sat, 21 Jul 2012)
@@ -136,3 +136,31 @@
$text );
return $text;
}
+
+function _preg_replace_bounds($front_regex,$back_regex,$front_replace,$back_replace,$text)
+{
+ $offset = 0;
+ $result = '';
+ while (TRUE)
+ {
+ $subject = substr($text,$offset);
+ if (preg_match($front_regex,$subject,$begin,PREG_OFFSET_CAPTURE) == 0 ||
+ preg_match($back_regex,$subject,$end,PREG_OFFSET_CAPTURE,
+ $begin[0][1]+strlen($begin[0][0])) == 0
+ )
+ { break; }
+ else
+ {
+ $result .= substr($subject,0,$begin[0][1]);
+ $result .= preg_replace($front_regex,$front_replace,$begin[0][0]);
+ $result .= substr(
+ $subject,
+ $begin[0][1]+strlen($begin[0][0]),
+ $end[0][1]-($begin[0][1]+strlen($begin[0][0])) );
+ $result .= preg_replace($back_regex,$back_replace,$end[0][0]);
+ $offset += $end[0][1]+strlen($end[0][0]);
+ }
+ }
+ if ($result === '') { return $text; }
+ else { return $result . substr($text,$offset); }
+}
Modified: website/public_html/beta/common/code/boost_utility.php
==============================================================================
--- website/public_html/beta/common/code/boost_utility.php (original)
+++ website/public_html/beta/common/code/boost_utility.php 2012-07-21 03:18:39 EDT (Sat, 21 Jul 2012)
@@ -6,36 +6,6 @@
*/
require_once(dirname(__FILE__) . '/boost.php');
-
-function _preg_replace_bounds($front_regex,$back_regex,$front_replace,$back_replace,$text)
-{
- $offset = 0;
- $result = '';
- while (TRUE)
- {
- $subject = substr($text,$offset);
- if (preg_match($front_regex,$subject,$begin,PREG_OFFSET_CAPTURE) == 0 ||
- preg_match($back_regex,$subject,$end,PREG_OFFSET_CAPTURE,
- $begin[0][1]+strlen($begin[0][0])) == 0
- )
- { break; }
- else
- {
- $result .= substr($subject,0,$begin[0][1]);
- $result .= preg_replace($front_regex,$front_replace,$begin[0][0]);
- $result .= substr(
- $subject,
- $begin[0][1]+strlen($begin[0][0]),
- $end[0][1]-($begin[0][1]+strlen($begin[0][0])) );
- $result .= preg_replace($back_regex,$back_replace,$end[0][0]);
- $offset += $end[0][1]+strlen($end[0][0]);
- }
- }
- if ($result === '') { return $text; }
- else { return $result . substr($text,$offset); }
-}
-
-
function _field_cmp_($r,$a,$b)
{
if ($r == 0) { return _field_cmp_name_($a,$b); }
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk