predicates.php
This file is part of the Parsica library.
Copyright (c) 2020 Mathias Verraes mathias@verraes.net
For the full copyright and license information, please view the LICENSE file that was distributed with this source code.
Table of Contents
Functions
- isEqual() : callable
- Creates an equality predicate
- notPred() : callable
- Negates a predicate.
- andPred() : callable
- Boolean And predicate.
- orPred() : callable
- Boolean Or predicate.
- isCharCode() : callable
- Predicate that checks if a character is in an array of character codes.
- isSpace() : callable
- Returns true for a space character, and the control characters \t, \n, \r, \f, \v.
- isHSpace() : callable
- Like 'isSpace', but does not accept newlines and carriage returns.
- isDigit() : callable
- True for 0-9
- isControl() : callable
- Control character predicate (a non-printing character of the Latin-1 subset of Unicode).
- isBlank() : callable
- Returns true for a space or a tab character
- isWhitespace() : callable
- Returns true for a space character, and \t, \n, \r, \f, \v.
- isUpper() : callable
- Returns true for an uppercase character A-Z.
- isLower() : mixed
- Returns true for a lowercase character a-z.
- isAlpha() : callable
- Returns true for an uppercase or lowercase character A-Z, a-z.
- isAlphaNum() : callable
- Returns true for an alpha or numeric character A-Z, a-z, 0-9.
- isHexDigit() : callable
- Returns true if the given character is a hexadecimal numeric character 0123456789abcdefABCDEF.
- isPrintable() : callable
- Returns true if the given character is a printable ASCII char.
- isPunctuation() : callable
- Returns true if the given character is a punctuation character !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
Functions
isEqual()
Creates an equality predicate
isEqual(string $x) : callable
Parameters
- $x : string
Tags
Return values
callablenotPred()
Negates a predicate.
notPred(callable $predicate) : callable
Parameters
- $predicate : callable
Tags
Return values
callableandPred()
Boolean And predicate.
andPred(callable $first, callable $second) : callable
Parameters
- $first : callable
- $second : callable
Tags
Return values
callableorPred()
Boolean Or predicate.
orPred(callable $first, callable $second) : callable
Parameters
- $first : callable
- $second : callable
Tags
Return values
callableisCharCode()
Predicate that checks if a character is in an array of character codes.
isCharCode(array<string|int, mixed> $chars) : callable
Parameters
- $chars : array<string|int, mixed>
Tags
Return values
callableisSpace()
Returns true for a space character, and the control characters \t, \n, \r, \f, \v.
isSpace() : callable
Tags
Return values
callableisHSpace()
Like 'isSpace', but does not accept newlines and carriage returns.
isHSpace() : callable
Tags
Return values
callableisDigit()
True for 0-9
isDigit() : callable
Tags
Return values
callableisControl()
Control character predicate (a non-printing character of the Latin-1 subset of Unicode).
isControl() : callable
Tags
Return values
callableisBlank()
Returns true for a space or a tab character
isBlank() : callable
Tags
Return values
callableisWhitespace()
Returns true for a space character, and \t, \n, \r, \f, \v.
isWhitespace() : callable
Tags
Return values
callableisUpper()
Returns true for an uppercase character A-Z.
isUpper() : callable
Tags
Return values
callableisLower()
Returns true for a lowercase character a-z.
isLower() : mixed
Tags
isAlpha()
Returns true for an uppercase or lowercase character A-Z, a-z.
isAlpha() : callable
Tags
Return values
callableisAlphaNum()
Returns true for an alpha or numeric character A-Z, a-z, 0-9.
isAlphaNum() : callable
Tags
Return values
callableisHexDigit()
Returns true if the given character is a hexadecimal numeric character 0123456789abcdefABCDEF.
isHexDigit() : callable
Tags
Return values
callableisPrintable()
Returns true if the given character is a printable ASCII char.
isPrintable() : callable
Tags
Return values
callableisPunctuation()
Returns true if the given character is a punctuation character !"#$%&'()*+,-./:;<=>?@[\]^_`{|}~
isPunctuation() : callable