RegEx

Utility class for building complex Regular Expressions

abstract
since

3.0.0

package

Joomla Framework

Methods

anyOf

Define a list of alternative expressions.

anyOf(string|array regexList) : 
static

Arguments

regexList

string|array<string|int, mixed>A list of Regular Expressions to choose from

Response

stringThe modified Regular Expression

capture

Assign a key to an expression.

capture( regex,  as = null) : 
static

Arguments

regex

stringThe Regular Expression to match

as

stringThe name of the component, used as index

Response

stringThe modified Regular Expression

match

Match the Regular Expression

match( regex,  subject) : mixed||string|int
static

Arguments

regex

stringThe Regular Expression

subject

stringThe string to check

Response

array<string|int, mixed>Captured values

noneOrMore

Add a 'zero or more' quantifier to an expression.

noneOrMore( regex) : 
static

Arguments

regex

stringThe Regular Expression to match

Response

stringThe modified Regular Expression

oneOrMore

Add a 'one or more' quantifier to an expression.

oneOrMore( regex) : 
static

Arguments

regex

stringThe Regular Expression to match

Response

stringThe modified Regular Expression

optional

Add a 'zero or one' quantifier to an expression.

optional( regex) : 
static

Arguments

regex

stringThe Regular Expression to match

Response

stringThe modified Regular Expression