Multiple choice technology web technology

What is the output for the below lines of code? var pattern = /(dr.*ing)/; var sentence = "The day started drizzling, but now it is heavily raining."; pattern.test(sentence); document.write(RegExp.$1);

  1. drizzling, but now it is heavily raining

  2. The day started drizzling, but now it is heavily raining

  3. drizzling

  4. null

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

The regex pattern /(dr.*ing)/ matches text starting with 'dr' and ending with 'ing', capturing everything in between. In the sentence, 'drizzling, but now it is heavily raining' matches this pattern (dr + izzling, but now it is heavily rain + ing). The match is stored in RegExp.$1.