Multiple choice technology programming languages

What is the value of $match? my $txt = 'I am learning Perl'; my ($match) = $txt =~ /\s(.*)\s/;

  1. am learning

  2. I am learning Perl

  3. learning

  4. am

  5. none

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

The regex /\s(.*)\s/ captures everything between the first and last whitespace characters. In 'I am learning Perl', it captures 'am learning' (between the space after 'I' and the space before 'Perl').