exam questions

Exam 70-483 All Questions

View all questions & answers for the 70-483 exam

Exam 70-483 topic 1 question 28 discussion

Actual exam question from Microsoft's 70-483
Question #: 28
Topic #: 1
[All 70-483 Questions]

You are developing a C# application that has a requirement to validate some string input data by using the Regex class.
The application includes a method named ContainsHyperlink. The ContainsHyperlink() method will verify the presence of a URI and surrounding markup.
The following code segment defines the ContainsHyperlink() method. (Line numbers are included for reference only.)

The expression patterns used for each validation function are constant.
You need to ensure that the expression syntax is evaluated only once when the Regex object is initially instantiated.
Which code segment should you insert at line 04?

  • A. Option A
  • B. Option B
  • C. Option C
  • D. Option D
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️
RegexOptions.Compiled - Specifies that the regular expression is compiled to an assembly. This yields faster execution but increases startup time. This value should not be assigned to the Options property when calling the CompileToAssembly method.
References:
http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regexoptions.aspx http://stackoverflow.com/questions/513412/how-does-regexoptions-compiled-work

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Albanzeu
4 years, 5 months ago
Can someone explain ?
upvoted 1 times
Rarabel
4 years, 5 months ago
By Default Regular Expression syntax is evaluated when the object of Regex is instantiated. When you are using RegexOptions.Compiled the first time it will be converted to MSIL and after be used from there - this increases performance during execution, but really slows down the startup although.
upvoted 2 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...