<?php

function isValidEmail($email) {
    return preg_match('/^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,10}$/', $email);
}

function isValidPassword($password){
    return preg_match("/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$#!%*?&])[A-Za-z\d@$!#%*?&]{8,}$/",$password);
}

function isValidNic($nic){
    return preg_match('/^([0-9]{9}[vVxX]|[0-9]{12})$/', $nic);
}

function isValidMobile($number) {
    return preg_match('/^(?:\+94|0)?(7[0-9]{8})$/', $number);
}

?>