$rule->entire_match= array_shift( $pattern_matches ); // The entire matched string is returned at index 0 $rule->named_arg_values= array_combine($rule->named_args, $pattern_matches); if( strlen($this->action) > 3 && $this->action{0} == '{' && $this->action{1} == '$' && $this->action{strlen($this->action)} == '}' ) { $subaction = trim($this->action, '{$}'); if( isset( $rule->named_arg_values[ $subaction ] ) ) { $this->action = $rule->named_arg_values[ $subaction ]; } }