Textpattern PHP Cross Reference Content Management Systems

Summary: /textpattern/vendors/Textpattern/Filter/StringFilter.php - 110 lines - 2949 bytes - Source - Print

Description: String filter.

Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

StringFilter:: (3 methods):
__construct()
match()
length()

Class: StringFilter


__construct($string line: 43
{@inheritdoc}

match($pattern, &$matches = null, $flags = 0, $offset = 0)  line: 56
Matches the string against a regular expression.

<code>
try
{
echo (string) Txp::get('Textpattern\Filter\StringFilter', 'Hello World!')->match('/^[^0-9]$/');
} catch (\Textpattern\Filter\Exception $e) {
echo $e->getMessage();
}
</code>

return: StringFilter
param: string $pattern The pattern
param: array  $matches Matches
param: int    $flags   Flags
param: int    $offset  Offset
length($min, $max = null)  line: 85
Limits the length.

<code>
try {
echo (string) Txp::get('Textpattern\Filter\StringFilter', 'Hello World!')->length(64);
} catch (\Textpattern\Filter\Exception $e) {
echo $e->getMessage();
}
</code>

return: StringFilter
param: int $min The minimum length
param: int $max The maximum length

title

Body