classes/phing/util/regexp/PregEngine.php

PREG Regexp Engine.

Implements a regexp engine using PHP's preg_match(), preg_match_all(), and preg_replace() functions.

author
hans lellelid, hans@velum.net
package
phing.util.regexp

\PregEngine

PREG Regexp Engine.

Implements a regexp engine using PHP's preg_match(), preg_match_all(), and preg_replace() functions.

Implements
\RegexpEngine
author
hans lellelid, hans@velum.net
package
phing.util.regexp

Properties

Propertyprivateboolean  $ignoreCase= 'null'

Set to null by default to distinguish between false and not set

Default valuenullDetails
Type
boolean
Propertyprivatestring  $modifiers= 'null'

Pattern modifiers

Default valuenullDetails
Type
string
link
http://php.net/manual/en/reference.pcre.pattern.modifiers.php
Propertyprivateboolean  $multiline= 'null'

Set to null by default to distinguish between false and not set

Default valuenullDetails
Type
boolean

Methods

methodpublic  getIgnoreCase( ) : boolean
Gets whether or not regex operation is case sensitive.
Returns
Type Description
boolean
methodpublic  getModifiers( ) : string
Gets pattern modifiers.
Returns
Type Description
string
methodpublic  getMultiline( ) : boolean
Gets whether regexp is to be applied in multiline mode.
Returns
Type Description
boolean
methodpublic  match( string $pattern, string $source, array $matches ) : boolean
Matches pattern against source string and sets the matches array.
Parameters
Name Type Description
$pattern string The regex pattern to match.
$source string The source string.
$matches array The array in which to store matches.
Returns
Type Description
boolean
methodpublic  matchAll( string $pattern, string $source, array $matches ) : boolean
Matches all patterns in source string and sets the matches array.
Parameters
Name Type Description
$pattern string The regex pattern to match.
$source string The source string.
$matches array The array in which to store matches.
Returns
Type Description
boolean
methodprivate  preparePattern( string $pattern ) : string
The pattern needs to be converted into PREG style -- which includes adding expression delims & any flags, etc.
Parameters
Name Type Description
$pattern string
Returns
Type Description
string
methodpublic  replace( string $pattern, string $replace, string $source ) : string
Replaces $pattern with $replace in $source string.

References to \1 group matches will be replaced with more preg-friendly $1.

Parameters
Name Type Description
$pattern string The regex pattern to match.
$replace string The string with which to replace matches.
$source string The source string.
Returns
Type Description
string
methodpublic  setIgnoreCase( boolean $bit ) : void
Sets whether or not regex operation is case sensitive.
Parameters
Name Type Description
$bit boolean
methodpublic  setModifiers( string $mods ) : void
Sets pattern modifiers for regex engine
Parameters
Name Type Description
$mods string Modifiers to be applied to a given regex
methodpublic  setMultiline( boolean $bit ) :
Sets whether regexp should be applied in multiline mode.
Parameters
Name Type Description
$bit boolean
Documentation was generated by DocBlox 0.13.1.