C# Class Pchp.Library.PerlRegex.RegexReplacement

Datei anzeigen Open project: iolevel/peachpie Class Usage Examples

Private Properties

Property Type Description
RegexReplacement System
Replace string
Replace string
Replacement string
ReplacementImpl void
ReplacementImplRTL void
Split string[]

Private Methods

Method Description
RegexReplacement ( string rep, RegexNode concat, int>.Dictionary _caps ) : System

Since RegexReplacement shares the same parser as Regex, the constructor takes a RegexNode which is a concatenation of constant strings and backreferences.

Replace ( MatchEvaluator evaluator, Regex regex, string input, int count, int startat ) : string

Replaces all occurrences of the regex in the string with the replacement evaluator. Note that the special case of no matches is handled on its own: with no matches, the input string is returned unchanged. The right-to-left case is split out because StringBuilder doesn't handle right-to-left string building directly very well.

Replace ( Regex regex, string input, int count, int startat ) : string

Replaces all occurrences of the regex in the string with the replacement pattern. Note that the special case of no matches is handled on its own: with no matches, the input string is returned unchanged. The right-to-left case is split out because StringBuilder doesn't handle right-to-left string building directly very well.

Replacement ( Match match ) : string

Returns the replacement result for a single match

ReplacementImpl ( StringBuilder sb, Match match ) : void

Given a Match, emits into the StringBuilder the evaluated substitution pattern.

ReplacementImplRTL ( List al, Match match ) : void

Given a Match, emits into the List{string} the evaluated Right-to-Left substitution pattern.

Split ( Regex regex, string input, int count, int startat ) : string[]

Does a split. In the right-to-left case we reorder the array to be forwards.