Multiple choice technology programming languages

What is the output of the following code snippet: \$mystring = "[2009/02/14] The date of this article."; if(\$mystring =~ m/(\d+)/) { print "$1"; }

  1. 14

  2. 02

  3. 2009

  4. Valentine's Day

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

The regex m/(\d+)/ matches the first sequence of digits in the string. In "[2009/02/14]", the first digit sequence is "2009". The special variable $1 captures this first match. Options A and B are incorrect because they represent later digit sequences (02 and 14).