@@ -22,79 +22,60 @@ public static partial class RegexHelper
2222 private const string CidrRegexValues = @"([1-9]|[1-2][0-9]|3[0-2])" ;
2323
2424 /// <summary>
25- /// Provides a compiled regular expression that matches valid IPv4 addresses in dot-decimal notation.
26- /// </summary>
27- /// <remarks>The returned regular expression is compiled for performance. Use this regex to validate or
28- /// extract IPv4 addresses from text. The pattern enforces correct octet ranges and dot separators.</remarks>
25+ /// Provides a compiled regular expression that matches valid IPv4 addresses in dot-decimal notation like "192.168.178.0".
26+ /// </summary>
2927 /// <returns>A <see cref="Regex"/> instance that matches IPv4 addresses in the format "x.x.x.x", where each x is a number
3028 /// from 0 to 255.</returns>
3129 [ GeneratedRegex ( $ "^{ IPv4AddressValues } $") ]
3230 public static partial Regex IPv4AddressRegex ( ) ;
3331
3432 /// <summary>
35- /// Provides a compiled regular expression that matches valid IPv4 addresses within input text.
36- /// </summary>
37- /// <remarks>The returned regular expression matches IPv4 addresses in standard dotted-decimal notation
38- /// (e.g., "192.168.1.1"). The regular expression is compiled for improved performance when used
39- /// repeatedly.</remarks>
33+ /// Provides a compiled regular expression that matches valid IPv4 addresses within input text like "192.168.178.0".
34+ /// </summary>
4035 /// <returns>A <see cref="Regex"/> instance that can be used to extract IPv4 addresses from strings.</returns>
4136 [ GeneratedRegex ( IPv4AddressValues ) ]
4237 public static partial Regex IPv4AddressExtractRegex ( ) ;
4338
4439 /// <summary>
45- /// Gets a regular expression that matches an IPv4 address range in the format "start-end", where both start and end
46- /// are valid IPv4 addresses.
47- /// </summary>
48- /// <remarks>The regular expression expects the input to consist of two IPv4 addresses separated by a
49- /// hyphen, with no additional whitespace or characters. Both addresses must be valid IPv4 addresses. This can be
50- /// used to validate or parse address range strings in network configuration scenarios.</remarks>
40+ /// Provides a compiles regular expression that matches IPv4 address ranges in the format "start-end" like
41+ /// "192.168.178.0-192.168.178.255".
42+ /// </summary>
5143 /// <returns>A <see cref="Regex"/> instance that matches strings representing IPv4 address ranges, such as
5244 /// "192.168.1.1-192.168.1.100".</returns>
5345 [ GeneratedRegex ( $ "^{ IPv4AddressValues } -{ IPv4AddressValues } $") ]
5446 public static partial Regex IPv4AddressRangeRegex ( ) ;
5547
5648 /// <summary>
57- /// Provides a compiled regular expression that matches valid IPv4 subnet mask values.
58- /// </summary>
59- /// <remarks>The returned regular expression is generated at compile time and is optimized for
60- /// performance. Use this regex to validate or parse subnet mask strings in IPv4 networking scenarios.</remarks>
49+ /// Provides a compiled regular expression that matches valid IPv4 subnet mask like "255.255.0.0".
50+ /// </summary>
6151 /// <returns>A <see cref="Regex"/> instance that matches strings representing valid IPv4 subnet masks.</returns>
6252 [ GeneratedRegex ( $ "^{ SubnetmaskValues } $") ]
6353 public static partial Regex SubnetmaskRegex ( ) ;
6454
6555 /// <summary>
66- /// Provides a compiled regular expression that matches IPv4 addresses with subnet masks in CIDR notation, such as
56+ /// Provides a compiled regular expression that matches IPv4 addresses with subnet masks like
6757 /// "192.168.178.0/255.255.255.0".
68- /// </summary>
69- /// <remarks>The returned regular expression validates both the IPv4 address and the subnet mask
70- /// components. Use this regex to verify input strings representing IPv4 subnets in formats like
71- /// "address/mask".</remarks>
58+ /// </summary>
7259 /// <returns>A <see cref="Regex"/> instance that matches strings containing an IPv4 address followed by a subnet mask,
7360 /// separated by a forward slash.</returns>
7461 [ GeneratedRegex ( $@ "^{ IPv4AddressValues } \/{ SubnetmaskValues } $") ]
7562 public static partial Regex IPv4AddressSubnetmaskRegex ( ) ;
7663
7764 /// <summary>
78- /// Provides a compiled regular expression that matches an IPv4 address in CIDR notation, such as
65+ /// Provides a compiled regular expression that matches an IPv4 address with CIDR like
7966 /// "192.168.178.0/24".
8067 /// </summary>
81- /// <remarks>The returned regular expression can be used to validate or extract IPv4 addresses with CIDR
82- /// notation, such as "192.168.1.0/24". The pattern enforces correct formatting for both the address and the prefix
83- /// length.</remarks>
8468 /// <returns>A <see cref="Regex"/> instance that matches strings containing an IPv4 address followed by a slash and a valid
8569 /// CIDR prefix length.</returns>
8670 [ GeneratedRegex ( $@ "^{ IPv4AddressValues } \/{ CidrRegexValues } $") ]
8771 public static partial Regex IPv4AddressCidrRegex ( ) ;
88-
72+
8973 /// <summary>
90- /// Creates a regular expression that matches IPv4 addresses, allowing for a special range in one or more octets.
91- /// </summary>
92- /// <remarks>The returned regular expression matches standard IPv4 addresses and addresses where one or
93- /// more octets are defined by a custom range pattern. This is useful for validating or parsing addresses such as
94- /// "192.168.[50-100].1" where a range is specified in place of an octet. The format and behavior of the special
95- /// range are determined by the <c>SpecialRangeRegex</c> value.</remarks>
96- /// <returns>A <see cref="Regex"/> instance that matches IPv4 addresses with support for custom special ranges as defined by
97- /// <c>SpecialRangeRegex</c>.</returns>
74+ /// Creates a regular expression that matches IPv4 addresses, allowing for a special range in one or more octets like
75+ /// "192.168.[0-50].1".
76+ /// </summary>
77+ /// <returns>A <see cref="Regex"/> instance that matches IPv4 addresses with support for custom special ranges like
78+ /// "192.168.[0-50].1".</returns>
9879 [ GeneratedRegex ( $@ "^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|{ SpecialRangeRegex } )\.){{3}}((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)|{ SpecialRangeRegex } )$") ]
9980 public static partial Regex IPv4AddressSpecialRangeRegex ( ) ;
10081
0 commit comments