C# Класс Pchp.Library.PCRE

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
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

Описание методов

preg_last_error() публичный статический Метод

public static preg_last_error ( ) : int
Результат int

preg_quote() публичный статический Метод

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.
Результат string

preg_replace() публичный статический Метод

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
Результат Pchp.Core.PhpValue

preg_replace() публичный статический Метод

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.
Результат Pchp.Core.PhpValue