diff --git a/functions/pcre.xml b/functions/pcre.xml index 0e236b4a03..dc77d07d0e 100644 --- a/functions/pcre.xml +++ b/functions/pcre.xml @@ -363,9 +363,9 @@ part 3: </a> Replacing several values -$patterns = array ("/(19|20\d{2})-(\d{1,2})-(\d{1,2})/", +$patterns = array ("/(19|20)(\d{2})-(\d{1,2})-(\d{1,2})/", "/^\s*{(\w+)}\s*=/"); -$replace = array ("\\3/\\4/\\1", "$\\1 ="); +$replace = array ("\\3/\\4/\\1\\2", "$\\1 ="); print preg_replace ($patterns, $replace, "{startDate} = 1999-5-27");