Documentation

RegularExpression
in package

Class RegularExpression

Tags
copyright

CLOUDREXX CMS - CLOUDREXX AG

author

Project Team SS4U info@cloudrexx.com

subpackage

lib_helpers

Table of Contents

Constants

VALIDATION_REGEX  = '([^a-zA-Z0-9\\\\x00])[^\1]+\1(?:[^\1]+\1)?[ixAUJ]*'
VALID_FLAGS  = [ 'i', // PCRE_CASELESS 'x', // PCRE_EXTENDED 'A', // PCRE_ANCHORED 'U', // PCRE_UNGREEDY 'J', ]

Properties

$delimiter  : string
Delimiter
$flags  : array<string|int, mixed>
Flags
$hasReplacement  : bool
Wheter this regex has a replacement or not
$regex  : string
Regex
$replacement  : string
Replacement string

Methods

__construct()  : mixed
Contructor for RegularExpression
__toString()  : string
Return the regular expression concatenated by delimiter
getDelimiter()  : string
Getter for Delimiter
getFlags()  : array<string|int, mixed>
Getter for flags
getRegex()  : string
Getter for $regex
getReplacement()  : string
Getter for $replacement
match()  : bool
Match the input string with regular expression
removeReplacement()  : mixed
Removes the replacement part.
replace()  : string
Search and replace in the Input string
setDelimiter()  : mixed
Set the delimiter
setFlags()  : mixed
Set the flags
setRegex()  : mixed
Set the regular expression
setReplacement()  : mixed
Set the replacement string

Constants

VALIDATION_REGEX

public mixed VALIDATION_REGEX = '([^a-zA-Z0-9\\\\x00])[^\1]+\1(?:[^\1]+\1)?[ixAUJ]*'

VALID_FLAGS

protected mixed VALID_FLAGS = [ 'i', // PCRE_CASELESS 'x', // PCRE_EXTENDED 'A', // PCRE_ANCHORED 'U', // PCRE_UNGREEDY 'J', ]

Properties

Methods

__construct()

Contructor for RegularExpression

public __construct([string $regex = '' ]) : mixed
Parameters
$regex : string = ''

Regular expression

__toString()

Return the regular expression concatenated by delimiter

public __toString() : string
Return values
string

Return the regular expression concatenated by delimiter

getFlags()

Getter for flags

public getFlags() : array<string|int, mixed>
Return values
array<string|int, mixed>

match()

Match the input string with regular expression

public match(string $input) : bool
Parameters
$input : string

Input string

Return values
bool

True|False True on regular expression matches the string

replace()

Search and replace in the Input string

public replace(string $input) : string
Parameters
$input : string

Input string

Return values
string

Replaced string

setDelimiter()

Set the delimiter

public setDelimiter(string $delimiter) : mixed
Parameters
$delimiter : string

setFlags()

Set the flags

public setFlags(array<string|int, mixed> $flags) : mixed
Parameters
$flags : array<string|int, mixed>

setRegex()

Set the regular expression

public setRegex(string $regex) : mixed
Parameters
$regex : string

        
On this page

Search results