http://www.perlmonks.org?node_id=11120954


in reply to capture value from two patterns

my ($id) = grep defined, (m!/key/(\d+)|/(\d+)-\d+!);