Added method \RTEX\Classes > Validate > validateRegex()
This commit is contained in:
parent
66cd6d0625
commit
cf36d18612
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue