i have a function which checks whether a URL contains any special characters and i want to add '%' to the allowed as i'm using %PREFIX% as a container. I'm relatively new to Regex and was wondering if someone could help me to add the % to the allowed list. The function is the below:
function specialChars($url)
{
if (preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url) != true)
{
$this->errors[] = "Please remove any special characters";
}
}
Thanks in advance. Regards,