Multiple choice technology testing

Predict the output:

Set r = New RegExp 
r.pattern = “ion$” Msgbox r.test(“consideration”)

  1. false

  2. true

  3. ion

  4. consideration

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The pattern 'ion$' uses the $ anchor to match strings ending with 'ion'. The test method 'consideration' ends with 'ion', so r.test returns True. Option A is incorrect because the pattern does match. Option C and D incorrectly return the matched string or input instead of the boolean result.