util/regexp/PregEngine.php

Show: inherited
Table of Contents

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

Package: phing\util\regexp

PREG Regexp Engine.

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

Parent(s)
\RegexpEngine
Author
hans lellelid, hans@velum.net  

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

methodpublicgetIgnoreCase( ) : boolean

Gets whether or not regex operation is case sensitive.

Returns
Type Description
boolean
methodpublicgetModifiers( ) : string

Gets pattern modifiers.

Returns
Type Description
string
methodpublicgetMultiline( ) : boolean

Gets whether regexp is to be applied in multiline mode.

Returns
Type Description
boolean
methodpublicmatch( 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 Success of matching operation.
methodpublicmatchAll( 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 Success of matching operation.
methodprivatepreparePattern( 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 prepared pattern.
methodpublicreplace( 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 The replaced source string.
methodpublicsetIgnoreCase( boolean $bit ) : void

Sets whether or not regex operation is case sensitive.

Parameters
Name Type Description
$bit boolean
methodpublicsetModifiers( string $mods ) : void

Sets pattern modifiers for regex engine

Parameters
Name Type Description
$mods string

Modifiers to be applied to a given regex

methodpublicsetMultiline( boolean $bit ) : void

Sets whether regexp should be applied in multiline mode.

Parameters
Name Type Description
$bit boolean
Documentation was generated by DocBlox 0.18.1.