form validation and regex not behaving as expected

Just seeking some feedback on form validation as I ran into a curious behavior which I have not managed to debug.

I am using different regex patterns in a php to validate form inputs: those regex work well. When I re-use those exact same regex patterns in the validation field available in form settings, then my forms refuse the inputs although they are matching the regex. I suppose there is a syntax trick thus why I ask here.

Some examples are as follows: $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,4}$/ui'; $string_exp = "/^[A-Za-z .'-]+$/"; $date_exp = "/^(?:(?:31(\/|-|.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/";