class AttributePreprocessor extends Regexp

Properties

protected bool $isGlobal from  Regexp
protected string $jsRegexp from  Regexp
protected string $regexp from  Regexp

Methods

__construct(string $regexp, bool $isGlobal = false)

Constructor

from  Regexp
string
__toString()

Return this regexp as a string

from  Regexp
array|Dictionary|null
asConfig()

Return an array-based representation of this object to be used for parsing

from  Regexp
mixed
filterConfig($target)

Return the config value for given target

from  Regexp
string[]
getCaptureNames()

Return the name of each capture in this regexp

from  Regexp
string
getJS()

Return this regexp's JavaScript representation

from  Regexp
array
getNamedCaptures()

Return all the named captures with a standalone regexp that matches them

from  Regexp
array
getNamedCapturesExpressions(array $tokens)

Return the expression used in each named capture

from  Regexp
void
setJS(string $jsRegexp)

Set this regexp's JavaScript representation

from  Regexp
array
getAttributes()

Return all the attributes created by the preprocessor along with the regexp that matches them

string
getRegexp()

Return the regexp this preprocessor is based on

Details

in Regexp at line 40
__construct(string $regexp, bool $isGlobal = false)

Constructor

Parameters

string $regexp

PCRE regexp, with delimiters and modifiers, e.g. "/foo/i"

bool $isGlobal

Whether this regexp should have the global flag set in JavaScript

in Regexp at line 56
string __toString()

Return this regexp as a string

Return Value

string

in Regexp at line 64
array|Dictionary|null asConfig()

Return an array-based representation of this object to be used for parsing

NOTE: if this method was named getConfig() it could interfere with magic getters from the Configurable trait

Return Value

array|Dictionary|null

in Regexp at line 72
mixed filterConfig($target)

Return the config value for given target

Parameters

$target

Return Value

mixed

in Regexp at line 82
string[] getCaptureNames()

Return the name of each capture in this regexp

Return Value

string[]

in Regexp at line 92
string getJS()

Return this regexp's JavaScript representation

Return Value

string

in Regexp at line 107
array getNamedCaptures()

Return all the named captures with a standalone regexp that matches them

Return Value

array

Array of [capture name => regexp]

in Regexp at line 134
protected array getNamedCapturesExpressions(array $tokens)

Return the expression used in each named capture

Parameters

array $tokens

Return Value

array

in Regexp at line 162
void setJS(string $jsRegexp)

Set this regexp's JavaScript representation

Parameters

string $jsRegexp

Return Value

void

at line 20
array getAttributes()

Return all the attributes created by the preprocessor along with the regexp that matches them

Return Value

array

Array of [attribute name => regexp]

at line 30
string getRegexp()

Return the regexp this preprocessor is based on

Return Value

string