本文整理汇总了C#中System.Text.RegularExpressions.Group类的典型用法代码示例。如果您正苦于以下问题:C# Group类的具体用法?C# Group怎么用?C# Group使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Group类属于System.Text.RegularExpressions命名空间,在下文中一共展示了Group类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReplaceUrlWithAbsoluteUrl
void ReplaceUrlWithAbsoluteUrl(StringBuilder builder, Group matchedUrlGroup, string currentDirectory)
{
var relativeUrl = matchedUrlGroup.Value.Trim('"', '\'');
var absoluteUrl = CreateAbsoluteUrl(relativeUrl, currentDirectory);
builder.Remove(matchedUrlGroup.Index, matchedUrlGroup.Length);
builder.Insert(matchedUrlGroup.Index, absoluteUrl);
}
示例2: GetPathThroughLastSlash
private string GetPathThroughLastSlash(SourceText text, int position, Group quotedPathGroup)
{
return PathCompletionUtilities.GetPathThroughLastSlash(
quotedPath: quotedPathGroup.Value,
quotedPathStart: GetQuotedPathStart(text, position, quotedPathGroup),
position: position);
}
示例3: CreateFrames
private IEnumerable<Frame> CreateFrames(
Group framesGroup)
{
return
from Capture capture in framesGroup.Captures
select CreateFrame(capture.Value);
}
示例4: GetTextChangeSpan
private TextSpan GetTextChangeSpan(SourceText text, int position, Group quotedPathGroup)
{
return PathCompletionUtilities.GetTextChangeSpan(
quotedPath: quotedPathGroup.Value,
quotedPathStart: GetQuotedPathStart(text, position, quotedPathGroup),
position: position);
}
示例5: Synchronized
public static Group Synchronized(Group inner)
{
Contract.Ensures(Contract.Result<System.Text.RegularExpressions.Group>() != null);
Contract.Ensures(Contract.Result<System.Text.RegularExpressions.Group>() == inner);
return default(Group);
}
示例6: ConcatenateCaptures
/// <summary>
/// Concatenates the captures of <paramref name="group" /> to a string.
/// </summary>
/// <param name="group"><see cref="Group" /> containing the captures.</param>
/// <returns>
/// <see cref="string" /> containg the concatenated captures.
/// </returns>
/// <remarks>
/// A named-group can captured multiple times, when the regular
/// expression has a quantifier, e.g. (// (?'Text'.*) )* will match
/// multiline comments with group <i>Text</i> having a capture for
/// every line.
/// </remarks>
private string ConcatenateCaptures(Group group) {
StringBuilder sb = new StringBuilder();
foreach (Capture capture in group.Captures) {
sb.Append(capture.Value);
}
return sb.ToString();
}
示例7: Synchronized
public static Group Synchronized(Group inner)
{
Contract.Requires(inner != null);
Contract.Ensures(Contract.Result<Group>() != null);
return default(Group);
}
示例8: AddSubNode
private void AddSubNode(int parentNodeIndex, string caption, Group captureGroup, int groupIndex)
{
TreeNode newNode = makeCaptureNode(caption);
Nodes[parentNodeIndex].Nodes.Add(newNode);
Nodes[parentNodeIndex].Nodes[groupIndex - 1].Tag = captureGroup;
Nodes[parentNodeIndex].Expand();
}
示例9: DisplayCaptures
private static void DisplayCaptures(Group group, TreeNode groupRoot)
{
foreach (Capture capture in group.Captures)
{
TreeNode captureRoot = new TreeNode(capture.Value);
groupRoot.Nodes.Add(captureRoot);
}
}
示例10: ParseDouble
public static double ParseDouble(Group @group)
{
if (@group.Captures.Count != 1)
{
throw new ArgumentException("Expected single capture");
}
return ParseDouble(@group.Value);
}
示例11: GroupToInt
private static int GroupToInt(Group g)
{
int value;
if (int.TryParse(g.ToString(), out value))
{
return value;
}
return -1;
}
示例12: EditUserForm
public EditUserForm()
{
InitializeComponent();
_userName = string.Empty;
_password = string.Empty;
GroupId = -1;
Groups = new Group[0];
}
示例13: ParseParameterGroup
private static IReadOnlyList<UriParameter> ParseParameterGroup(Group group)
{
if (!group.Success)
return new UriParameter[] { };
var parameters = group.Value;
var splitByAmpersand = parameters.Split('&');
return splitByAmpersand.Select(ParseParameterPart).ToArray();
}
示例14: GetImageFilename
string GetImageFilename(Group matchedUrlGroup, string currentDirectory)
{
var originalUrl = matchedUrlGroup.Value.Trim('"', '\'');
if (originalUrl.StartsWith("/"))
{
return PathUtilities.NormalizePath("~" + originalUrl);
}
return PathUtilities.NormalizePath(PathUtilities.CombineWithForwardSlashes(currentDirectory, originalUrl));
}
示例15: GetDistinctCount
private static string GetDistinctCount(string @select, Group g, string @from)
{
var columns = g.ToString().Trim();
if(columns == "DISTINCT")
{
throw new ArgumentException("Malformed SQL; DISTINCT queries must specify at least one column");
}
var distinct = string.Concat(@select, "COUNT(", columns, ") ", @from);
return distinct;
}