Multiple choice general knowledge

Which of the below examples of a programming code contains an example of a regular expression?

  1. $expression = 1;
  2. my @expression;

  3. $total = $exp + $exp2;
  4. $total =~ s/[0-9]+/\*//g;
Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Option D shows a Perl substitution operation using regex pattern /[0-9]+/ to match digits, which is a clear example of a regular expression. Options A, B, and C are basic variable assignments without any pattern matching.