using System;
using System.Text.RegularExpressions;
public class Example
{
public static void Main()
{
string pattern = @"([^\n\r:]*)(:[ \t])[ \t]*([^\n\r]*)";
string input = @"NetRange: 2001:4860:: - 2001:4860:FFFF:FFFF:FFFF:FFFF:FFFF:FFFF
CIDR: 2001:4860::/32
NetName: GOOGLE-IPV6
NetHandle: NET6-2001-4860-1
Parent: ARIN-004 (NET6-2001-4800-0)
NetType: Direct Allocation
OriginAS: AS15169
Organization: Google LLC (GOGL)
RegDate: 2005-03-14
Updated: 2012-02-24
Ref: https://rdap.arin.net/registry/ip/2001:4860::
OrgName: Google LLC
OrgId: GOGL
Address: 1600 Amphitheatre Parkway
City: Mountain View
StateProv: CA
PostalCode: 94043
Country: US
RegDate: 2000-03-30
Updated: 2019-10-31
Comment: Please note that the recommended way to file abuse complaints are located in the following links.
Comment:
Comment: To report abuse and illegal activity: https://www.google.com/contact/
Comment:
Comment: For legal requests: http://support.google.com/legal
Comment:
Comment: Regards,
Comment: The Google Team
Ref: https://rdap.arin.net/registry/entity/GOGL
OrgTechHandle: ZG39-ARIN
OrgTechName: Google LLC
OrgTechPhone: +1-650-253-0000
OrgTechEmail: arin-contact@google.com
OrgTechRef: https://rdap.arin.net/registry/entity/ZG39-ARIN
OrgAbuseHandle: ABUSE5250-ARIN
OrgAbuseName: Abuse
OrgAbusePhone: +1-650-253-0000
OrgAbuseEmail: network-abuse@google.com
OrgAbuseRef: https://rdap.arin.net/registry/entity/ABUSE5250-ARIN
RNOCHandle: ZG39-ARIN
RNOCName: Google LLC
RNOCPhone: +1-650-253-0000
RNOCEmail: arin-contact@google.com
RNOCRef: https://rdap.arin.net/registry/entity/ZG39-ARIN
RTechHandle: ZG39-ARIN
RTechName: Google LLC
RTechPhone: +1-650-253-0000
RTechEmail: arin-contact@google.com
RTechRef: https://rdap.arin.net/registry/entity/ZG39-ARIN
RAbuseHandle: ZG39-ARIN
RAbuseName: Google LLC
RAbusePhone: +1-650-253-0000
RAbuseEmail: arin-contact@google.com
RAbuseRef: https://rdap.arin.net/registry/entity/ZG39-ARIN";
RegexOptions options = RegexOptions.Multiline;
foreach (Match m in Regex.Matches(input, pattern, options))
{
Console.WriteLine("'{0}' found at index {1}.", m.Value, m.Index);
}
}
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for C#, please visit: https://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex(v=vs.110).aspx