You are tasked to create a BRANCH which will execute a service only if a string named "partNo" begins with "WEBM". With the evaluate labels parameter set to "true", what is the correct syntax for the label of the service?

  1. %partNo%=="WEBM*"

  2. %partNo%==/^WEBM/

  3. %partNo%==/$WEBM/

  4. %partNo%!=/WEBM.*/


Correct Option: B

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) %partNo%=="WEBM*" - This option is incorrect because the asterisk (*) is not a valid wildcard character in this context. It should be replaced with a regular expression.

Option B) %partNo%==/^WEBM/ - This option is correct. The syntax "/^WEBM/" is a regular expression that matches any string that begins with "WEBM". Therefore, it satisfies the requirement of the question.

Option C) %partNo%==/$WEBM/ - This option is incorrect because the dollar sign ($) is not a valid character in this context. It should be replaced with a regular expression.

Option D) %partNo%!=/WEBM./ - This option is incorrect because the question asks for the label of the service, not the condition to exclude the service. Additionally, the regular expression "/WEBM./" matches any string that contains "WEBM" followed by any number of characters.

The correct answer is B. This option is correct because "/^WEBM/" is a regular expression that matches any string that begins with "WEBM".

Find more quizzes: