Validate that given value matches regex pattern.
If given value matches, value is returned. If not, blank is returned.
Usage
$string = $sanitizer->match(string $value, string $regex);
Arguments
Name | Type(s) | Description |
---|---|---|
value | string | Value to match |
regex | string | PCRE regex pattern (same as you would provide to PHP's |
Return value
string
Value you supplied if it matches, or blank string if it doesn't
$sanitizer methods and properties
API reference based on ProcessWire core version 3.0.236