C# Class System.Text.RegularExpressions.RegexReplacement

显示文件 Open project: dotnet/corefx Class Usage Examples

Private Properties

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

Private Methods

Method Description
RegexReplacement ( string rep, RegexNode concat, Hashtable _caps ) : System.Collections

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 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.