C# Class Pchp.Library.PCRE

ファイルを表示 Open project: iolevel/peachpie Class Usage Examples

Public Methods

Method Description
preg_last_error ( ) : int
preg_quote ( string str, string delimiter = null ) : string

Quote regular expression characters.

The special regular expression characters are: . \ + * ? [ ^ ] $ ( ) { } = ! < > | : - Note that / is not a special regular expression character.

preg_replace ( Context ctx, PhpValue pattern, PhpValue replacement, PhpValue subject, int limit = -1 ) : PhpValue
preg_replace ( Context ctx, PhpValue pattern, PhpValue replacement, PhpValue subject, int limit, long &count ) : PhpValue

Perform a regular expression search and replace.

Private Methods

Method Description
preg_grep ( Context ctx, string pattern, PhpArray input, int flags ) : PhpArray
preg_grep ( string pattern, PhpArray input, int flags ) : PhpArray
preg_match ( Context ctx, string pattern, string subject ) : int
preg_match ( Context ctx, string pattern, string subject, PhpArray &matches, int flags, long offset ) : int
preg_match_all ( Context ctx, string pattern, string subject ) : int
preg_match_all ( Context ctx, string pattern, string subject, PhpArray &matches, int flags = PREG_PATTERN_ORDER, int offset ) : int
preg_replace ( Context ctx, string pattern, string replacement, PhpCallable callback, PhpValue subject, int limit, long &count ) : PhpValue
preg_split ( string pattern, string subject, int limit = -1, int flags ) : PhpArray

Method Details

preg_last_error() public static method

public static preg_last_error ( ) : int
return int

preg_quote() public static method

Quote regular expression characters.
The special regular expression characters are: . \ + * ? [ ^ ] $ ( ) { } = ! < > | : - Note that / is not a special regular expression character.
public static preg_quote ( string str, string delimiter = null ) : string
str string The string to be escaped.
delimiter string If the optional delimiter is specified, it will also be escaped. /// This is useful for escaping the delimiter that is required by the PCRE functions. The / is the most commonly used delimiter.
return string

preg_replace() public static method

public static preg_replace ( Context ctx, PhpValue pattern, PhpValue replacement, PhpValue subject, int limit = -1 ) : PhpValue
ctx Pchp.Core.Context
pattern Pchp.Core.PhpValue
replacement Pchp.Core.PhpValue
subject Pchp.Core.PhpValue
limit int
return Pchp.Core.PhpValue

preg_replace() public static method

Perform a regular expression search and replace.
public static preg_replace ( Context ctx, PhpValue pattern, PhpValue replacement, PhpValue subject, int limit, long &count ) : PhpValue
ctx Pchp.Core.Context A reference to current context. Cannot be null.
pattern Pchp.Core.PhpValue The pattern to search for. It can be either a string or an array with strings.
replacement Pchp.Core.PhpValue The string or an array with strings to replace. /// If this parameter is a string and the pattern parameter is an array, all patterns will be /// replaced by that string. If both pattern and replacement parameters are arrays, each pattern will be /// replaced by the replacement counterpart. If there are fewer elements in the replacement array than /// in the pattern array, any extra patterns will be replaced by an empty string.
subject Pchp.Core.PhpValue The string or an array with strings to search and replace. /// If subject is an array, then the search and replace is performed on every entry of subject, and the return value is an array as well.
limit int The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit).
count long This variable will be filled with the number of replacements done.
return Pchp.Core.PhpValue