Documentation

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
bool

matchFloat()

public static matchFloat(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchInteger()

public static matchInteger(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchIntegerID()

public static matchIntegerID(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchNegativeInteger()

public static matchNegativeInteger(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchNumber()

public static matchNumber(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchPositiveInteger()

public static matchPositiveInteger(int|float|string $subject) : bool
Parameters
$subject : int|float|string
Return values
bool

matchQuery()

public static matchQuery(string $subject) : bool
Parameters
$subject : string
Return values
bool

matchText()

public static matchText(string $subject) : bool
Parameters
$subject : string
Return values
bool

pattern()

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
Return values
string

        
On this page

Search results