Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.708
diff -u -F^f -r1.708 common.inc
--- includes/common.inc	25 Oct 2007 15:38:24 -0000	1.708
+++ includes/common.inc	1 Nov 2007 22:43:06 -0000
@@ -2008,7 +2008,7 @@ function _packer_apply($script, $regexps
     if (is_string($replacement)) {
       // Does the pattern deal with sub-expressions?
       if (preg_match('/\$\d/', $replacement)) {
-        if (preg_match('/^\$\d+$/', $replacement)) {
+        if (preg_match('/\A\$\d+\z/', $replacement)) {
           // A simple lookup (e.g. "$2")
           // Store the index (used for fast retrieval of matched strings)
           $replacement = (int)(substr($replacement, 1));
