Regex
in package
Table of Contents
Constants
- FLOAT_PATTERN = '/^[+-]?[0-9]*[.,]{1}[0-9]+$/'
- INT_ID_PATTERN = '/^[1-9]+[0-9]*$/'
- INT_NEG_PATTERN = '/^[-]{1}[0-9]+$/'
- INT_PATTERN = '/^[+-]?[0-9]+$/'
- INT_POS_PATTERN = '/^[+]?[0-9]+$/'
- NUMBER_PATTERN = '/^[+-]?([0-9]*[.,]{1})?[0-9]+$/'
- QUERY_PATTERN = '/^[\\w\\/\\.?=&]+$/'
- SANTIZE_PATTERN = '/[^\\w]+/'
- TEXT_PATTERN = '/^.*$/'
Methods
- match() : bool
- matchFloat() : bool
- matchInteger() : bool
- matchIntegerID() : bool
- matchNegativeInteger() : bool
- matchNumber() : bool
- matchPositiveInteger() : bool
- matchQuery() : bool
- matchText() : bool
- pattern() : null|array<string|int, mixed>
- Returns the matches of the pattern in the subject. If no match is found, null is returned.
- sanitize() : string
Constants
FLOAT_PATTERN
private
mixed
FLOAT_PATTERN
= '/^[+-]?[0-9]*[.,]{1}[0-9]+$/'
INT_ID_PATTERN
private
mixed
INT_ID_PATTERN
= '/^[1-9]+[0-9]*$/'
INT_NEG_PATTERN
private
mixed
INT_NEG_PATTERN
= '/^[-]{1}[0-9]+$/'
INT_PATTERN
private
mixed
INT_PATTERN
= '/^[+-]?[0-9]+$/'
INT_POS_PATTERN
private
mixed
INT_POS_PATTERN
= '/^[+]?[0-9]+$/'
NUMBER_PATTERN
private
mixed
NUMBER_PATTERN
= '/^[+-]?([0-9]*[.,]{1})?[0-9]+$/'
QUERY_PATTERN
private
mixed
QUERY_PATTERN
= '/^[\\w\\/\\.?=&]+$/'
SANTIZE_PATTERN
private
mixed
SANTIZE_PATTERN
= '/[^\\w]+/'
TEXT_PATTERN
private
mixed
TEXT_PATTERN
= '/^.*$/'
Methods
match()
public
static match(string $pattern, int|float|string $subject) : bool
Parameters
- $pattern : string
- $subject : int|float|string
Return values
boolmatchFloat()
public
static matchFloat(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchInteger()
public
static matchInteger(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchIntegerID()
public
static matchIntegerID(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchNegativeInteger()
public
static matchNegativeInteger(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchNumber()
public
static matchNumber(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchPositiveInteger()
public
static matchPositiveInteger(int|float|string $subject) : bool
Parameters
- $subject : int|float|string
Return values
boolmatchQuery()
public
static matchQuery(string $subject) : bool
Parameters
- $subject : string
Return values
boolmatchText()
public
static matchText(string $subject) : bool
Parameters
- $subject : string
Return values
boolpattern()
Returns the matches of the pattern in the subject. If no match is found, null is returned.
public
static pattern(string $pattern, string $subject) : null|array<string|int, mixed>
Parameters
- $pattern : string
- $subject : string
Return values
null|array<string|int, mixed>sanitize()
public
static sanitize(string $subject) : string
Parameters
- $subject : string