Tuesday, September 11, 2018

Perl: How to capture a regex match in one line

my ($match) = "some string" =~ /(some).*/;
print $match; # prints "some"