I would like to validate date field to accept only (dd/mm/yyyy)
format, for example
(14/11/1993)
In addition if the month is February it should not accept day 30 and 31. Please help any one, I've already tried with the pattern below but it's not working in Yii 2. It shows error in RegularExpressionValidator.php
[
['dateofbirth'],
'match',
'pattern' => '/^((([1-2][0-9])|([1-9]))/([2])/[0-9]{4})|((([1-2][0-9])|([1-9])|(3[0-1]))/((1[0-2])|([3-9])|([1]))/[0-9]{4})$/',
'message' =>'Invalid date'
],