Added method \RTEX\Classes > Validate > validateRegex()

This commit is contained in:
Netkas 2022-12-27 02:51:54 -05:00
parent 66cd6d0625
commit cf36d18612

View file

@ -16,7 +16,7 @@
{
try
{
Utilities::determineType($type);
Utilities::getType($type);
}
catch(Exception $e)
{
@ -26,4 +26,16 @@
return true;
}
/**
* Validates the input with a regex pattern
*
* @param string $input
* @param string $pattern
* @return bool
*/
public static function validateRegex(string $input, string $pattern): bool
{
return preg_match($pattern, $input) === 1;
}
}