You need to ensure that the method extracts a list of URLs that match the following pattern: @http://(www\\.)?([^\\.]+)\\.com; Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\\.)?([^\\.]+)\\.com;
Which code should you insert at line 07?

You write the following method (line numbers are included for reference only):

You need to ensure that the method extracts a list of URLs that match the following pattern:
@http://(www\\.)?([^\\.]+)\\.com;
Which code should you insert at line 07?

A.
Option A

B.
Option B

C.
Option C

D.
Option D

Explanation:
The MatchCollection.GetEnumerator method returns an enumerator that iterates through a
collection.
Note:
The MatchCollection Class represents the set of successful matches found by iteratively applying a
regular expression pattern to the input string.
MatchCollection.GetEnumerator Method
https://msdn.microsoft.com/enus/library/system.text.regularexpressions.matchcollection.getenumerator(v=vs.110).aspx



Leave a Reply 10

Your email address will not be published. Required fields are marked *

five − 3 =


Xabi

Xabi

Correct is C

sv1slim

sv1slim

correct is C
A is failing with an error “unable to cast”

harsh

harsh

I did not get any cast compile time error:
MatchCollection match = Regex.Matches(“”, “”);
List result =(List) match.GetEnumerator();

Answer should be A

Andrea

Andrea

Is not a compile time error, but a Runtime error. Because the GetEnumerator returns a List, not a List.
Correct is C

Najlepszy Programista Swiata DAGO

Najlepszy Programista Swiata DAGO

C

#BILL GATES

#BILL GATES

C JAK CIPSKO

Begia

Begia

error message when use A answer

Unable to cast object of type ‘System.Text.RegularExpressions.MatchEnumerator’ to type ‘System.Collections.Generic.List`1[System.String]’.

so correct answer is C

Heitor

Heitor

yeah, that’s right.

Lord Vader

Lord Vader

A wants a non generic collection. a generic collection is returned so u get a compilation error.

C