addElement('text', 'pattern', array( 'label' => 'Regex pattern', 'required' => true, )); $form->addElement('text', 'replacement', array( 'label' => 'Replacement', 'required' => true, )); } public function transform($value) { return substr($value, $this->settings['start'], $this->settings['end'] - $this->settings['start']); } }