Reverse Instructional Design: regex

Jul 25, 2014 • Daisie Huang

This would be following a lesson on regex (using perl syntax)

 

In the following code snippet:

“foo bar 123 bar23 foo baz” =~ /(.+?s){3}..(.+)s/;

what would be the result in $2 (the second captured group)?

a) o

b) r23 foo

c) r23

d) bar23

How would one capture the expression “123” from that same string?