I am trying to figure out, how can I validate input field for website address. I have field where users needs to put youtube video address for example http://www.youtube.com/watch?v=biFodVJiqpU . I need to check provided web address against this bit of address http://www.youtube.com/watch?v= , that it is identical. Is it possible to do with Validation rule regex ? If yes, what I need to write in regex array ?
protected $_rules = array(
'video' => array(
'not_empty' => NULL,
'regex' => array(''),
'exact_length' =>array(42)
),
);
Try this regex, it should work