Skip to content

Commit 9b49aaf

Browse files
committed
Merge branch 'master' into publish-6598
2 parents 2b6bc00 + 0cd6338 commit 9b49aaf

File tree

9 files changed

+54
-3840
lines changed

9 files changed

+54
-3840
lines changed

xml/System.Collections.Immutable/ImmutableList`1+Builder.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ This member is an explicit interface member implementation. It can be used only
23492349
<format type="text/markdown"><![CDATA[
23502350
23512351
## Remarks
2352-
This method is an O(n) operation and approaches O(1) time as the number of actual mutations to the set since the last call to this method approaches 0.
2352+
This method is an O(n) operation and approaches O(log n) time as the number of actual mutations to the set since the last call to this method approaches 0.
23532353
23542354
]]></format>
23552355
</remarks>

xml/System.Text.RegularExpressions/Capture.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
5656
## Examples
5757
The following example defines a regular expression that matches sentences that contain no punctuation except for a period (".").
58-
59-
[!code-csharp[System.Text.RegularExpressions.Capture.Class#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/cs/example1.cs#1)]
60-
[!code-vb[System.Text.RegularExpressions.Capture.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/vb/example1.vb#1)]
58+
59+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/cs/example1.cs" interactive="try-dotnet" id="Snippet1":::
60+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/vb/example1.vb" id="Snippet1":::
6161
6262
The regular expression pattern `((\w+)[\s.])+` is defined as shown in the following table. Note that in this regular expression, a quantifier (+) is applied to the entire regular expression.
6363
@@ -265,9 +265,9 @@
265265
266266
## Examples
267267
The following example defines a regular expression that matches sentences that contain no punctuation except for a period ("."). The `Match.Value` property displays the result string, which consists of a matched sentence, for each match. The `Group.Value` property displays the result string for each capturing group; it consists of the last string captured by that capturing group. The <xref:System.Text.RegularExpressions.Capture.Value%2A?displayProperty=nameWithType> property displays the result string for each capture.
268-
269-
[!code-csharp[System.Text.RegularExpressions.Capture.Class#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/cs/example1.cs#1)]
270-
[!code-vb[System.Text.RegularExpressions.Capture.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/vb/example1.vb#1)]
268+
269+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/cs/example1.cs" interactive="try-dotnet" id="Snippet1":::
270+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.class/vb/example1.vb" id="Snippet1":::
271271
272272
The regular expression pattern `((\w+)[\s.])+` is defined as shown in the following table. Note that in this regular expression, a quantifier (+) is applied to the entire regular expression.
273273
@@ -282,8 +282,8 @@
282282
283283
The following example uses a regular expression pattern, `^([a-z]+)(\d+)*\.([a-z]+(\d)*)$`, to match a product number that consists of two parts separated by a period. Both parts consist of alphabetic characters followed by optional numbers. Because the first input string does not match the pattern, the value of the returned <xref:System.Text.RegularExpressions.Match?displayProperty=nameWithType> object's `Value` property is <xref:System.String.Empty?displayProperty=nameWithType>. Similarly, when the regular expression pattern is unable to match a capturing group, the value of the corresponding <xref:System.Text.RegularExpressions.Group> object's `Value` property is <xref:System.String.Empty?displayProperty=nameWithType>.
284284
285-
[!code-csharp[System.Text.RegularExpressions.Capture.Value#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.value/cs/value1.cs#1)]
286-
[!code-vb[System.Text.RegularExpressions.Capture.Value#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.value/vb/value1.vb#1)]
285+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capture.value/cs/value1.cs" interactive="try-dotnet" id="Snippet1":::
286+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capture.value/vb/value1.vb" id="Snippet1":::
287287
288288
The regular expression pattern is defined as shown in the following table:
289289

xml/System.Text.RegularExpressions/CaptureCollection.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@
8282
- `(\b\w+\W{1,2})+`
8383
8484
This regular expression pattern identifies the words in a sentence. The pattern defines a single capturing group that consists of one or more word characters followed by one or two non-word characters. The regular expression pattern uses the `+` quantifier to match one or more occurrences of this group. The output from this example shows that the <xref:System.Text.RegularExpressions.Match> object and the <xref:System.Text.RegularExpressions.CaptureCollection> object returned by the `Match.Captures` property contain information about the same match. The second <xref:System.Text.RegularExpressions.Group> object, which corresponds to the only capturing group in the regular expression, identifies only the last captured string, whereas the <xref:System.Text.RegularExpressions.CaptureCollection> object returned by the first capturing group's <xref:System.Text.RegularExpressions.Group.Captures%2A?displayProperty=nameWithType> property includes all captured substrings.
85-
86-
[!code-csharp[System.Text.RegularExpressions.CaptureCollection#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capturecollection/cs/capturecollectionex1.cs#1)]
87-
[!code-vb[System.Text.RegularExpressions.CaptureCollection#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capturecollection/vb/capturecollectionex1.vb#1)]
85+
86+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.capturecollection/cs/capturecollectionex1.cs" interactive="try-dotnet" id="Snippet1":::
87+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.capturecollection/vb/capturecollectionex1.vb" id="Snippet1":::
8888
8989
]]></format>
9090
</remarks>

xml/System.Text.RegularExpressions/Group.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
6363
In this regular expression pattern, the subpattern `(\w+?)` is designed to match multiple words within a sentence. However, the value of the <xref:System.Text.RegularExpressions.Group> object represents only the last match that `(\w+?)` captures, whereas the <xref:System.Text.RegularExpressions.Group.Captures%2A> property returns a <xref:System.Text.RegularExpressions.CaptureCollection> that represents all captured text. As the output shows, the <xref:System.Text.RegularExpressions.CaptureCollection> for the second capturing group contains four objects. The last of these corresponds to the <xref:System.Text.RegularExpressions.Group> object.
6464
65-
[!code-csharp[System.Text.RegularExpressions.Group.Class#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.class/cs/groupandcaptures1.cs#1)]
66-
[!code-vb[System.Text.RegularExpressions.Group.Class#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.class/vb/groupandcaptures1.vb#1)]
65+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.class/cs/groupandcaptures1.cs" interactive="try-dotnet" id="Snippet1":::
66+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.class/vb/groupandcaptures1.vb" id="Snippet1":::
6767
6868
]]></format>
6969
</remarks>
@@ -112,13 +112,13 @@
112112
## Remarks
113113
If a quantifier is not applied to a capturing group, the collection returned by the <xref:System.Text.RegularExpressions.Group.Captures%2A> property contains a single <xref:System.Text.RegularExpressions.Capture> object that provides information about the same substring as the <xref:System.Text.RegularExpressions.Group> object. This is illustrated in the following example. It defines a regular expression, `\b(\w+)\b`, that extracts a single word from a sentence. The <xref:System.Text.RegularExpressions.Group> object captures the word "This", and the single object in the <xref:System.Text.RegularExpressions.CaptureCollection> contains information about the same capture.
114114
115-
[!code-csharp[System.Text.RegularExpressions.Group.Captures#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/cs/captures1.cs#1)]
116-
[!code-vb[System.Text.RegularExpressions.Group.Captures#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/vb/captures1.vb#1)]
115+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/cs/captures1.cs" interactive="try-dotnet" id="Snippet1":::
116+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/vb/captures1.vb" id="Snippet1":::
117117
118118
The real utility of the <xref:System.Text.RegularExpressions.Group.Captures%2A> property occurs when a quantifier is applied to a capturing group so that the group captures multiple substrings in a single regular expression. In this case, the <xref:System.Text.RegularExpressions.Group> object contains information about the last captured substring, whereas the <xref:System.Text.RegularExpressions.Group.Captures%2A> property contains information about all the substrings captured by the group. In the following example, the regular expression `\b(\w+\s*)+\.` matches an entire sentence that ends in a period. The group `(\w+\s*)+` captures the individual words in the collection. Because the <xref:System.Text.RegularExpressions.Group> collection contains information only about the last captured substring, it captures the last word in the sentence, "sentence". However, each word captured by the group is available from the collection returned by the <xref:System.Text.RegularExpressions.Group.Captures%2A> property.
119-
120-
[!code-csharp[System.Text.RegularExpressions.Group.Captures#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/cs/captures2.cs#2)]
121-
[!code-vb[System.Text.RegularExpressions.Group.Captures#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/vb/captures2.vb#2)]
119+
120+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/cs/captures2.cs" interactive="try-dotnet" id="Snippet2":::
121+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.group.captures/vb/captures2.vb" id="Snippet2":::
122122
123123
]]></format>
124124
</remarks>

xml/System.Text.RegularExpressions/GroupCollection.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
8585
For each match, the <xref:System.Text.RegularExpressions.GroupCollection> contains three <xref:System.Text.RegularExpressions.Group> objects. The first object contains the string that matches the entire regular expression. The second object, which represents the first captured group, contains the product name. The third object, which represents the second captured group, contains the trademark or registered trademark symbol.
8686
87-
[!code-csharp[System.Text.RegularExpressions.GroupCollection#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.GroupCollection/cs/Example1.cs#1)]
88-
[!code-vb[System.Text.RegularExpressions.GroupCollection#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.GroupCollection/vb/Example1.vb#1)]
89-
87+
[!code-csharp[System.Text.RegularExpressions.GroupCollection#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.Text.RegularExpressions.GroupCollection/cs/Example1.cs#1)]
88+
[!code-vb[System.Text.RegularExpressions.GroupCollection#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.Text.RegularExpressions.GroupCollection/vb/Example1.vb#1)]
89+
9090
]]></format>
9191
</remarks>
9292
<altmember cref="T:System.Text.RegularExpressions.Group" />
@@ -184,8 +184,8 @@
184184
## Examples
185185
The following example extracts each word from a sentence and captures it in a capturing group, The <xref:System.Text.RegularExpressions.GroupCollection.CopyTo%2A> method is then used to copy the elements in each match's <xref:System.Text.RegularExpressions.GroupCollection> object to an array that contains the capturing groups from all matches. The individual captured words are then displayed to the console.
186186
187-
[!code-csharp[System.Text.RegularExpressions.GroupCollection.CopyTo#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.copyto/cs/copyto1.cs#1)]
188-
[!code-vb[System.Text.RegularExpressions.GroupCollection.CopyTo#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.copyto/vb/copyto1.vb#1)]
187+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.copyto/cs/copyto1.cs" interactive="try-dotnet" id="Snippet1":::
188+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.copyto/vb/copyto1.vb" id="Snippet1":::
189189
190190
The regular expression is defined as follows:
191191
@@ -536,8 +536,8 @@
536536
|`(\w)`|This is the second capturing group.|
537537
|`\k`|Match the string captured by the second capturing group.|
538538
539-
[!code-csharp[System.Text.RegularExpressions.GroupCollection.Item#2](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/cs/item3.cs#2)]
540-
[!code-vb[System.Text.RegularExpressions.GroupCollection.Item#2](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/vb/item3.vb#2)]
539+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/cs/item3.cs" interactive="try-dotnet" id="Snippet2":::
540+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/vb/item3.vb" id="Snippet2":::
541541
542542
]]></format>
543543
</remarks>
@@ -608,9 +608,9 @@
608608
|`(?<numbers>\d+)*`|Match one or more occurrence of a decimal digit. Name this the `numbers` capturing group. Match this pattern either zero or one time.|
609609
|`(?<letter>\w)`|Match a single word character. Name this the `letter` capturing group.|
610610
|`\k<letter>`|Match the string captured by the `letter` capturing group.|
611-
612-
[!code-csharp[System.Text.RegularExpressions.GroupCollection.Item#1](~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/cs/item2.cs#1)]
613-
[!code-vb[System.Text.RegularExpressions.GroupCollection.Item#1](~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/vb/item2.vb#1)]
611+
612+
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/cs/item2.cs" interactive="try-dotnet" id="Snippet1":::
613+
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CLR_System/system.text.regularexpressions.groupcollection.item/vb/item2.vb" id="Snippet1":::
614614
615615
]]></format>
616616
</remarks>

0 commit comments

Comments
 (0)