my ($id) = grep defined, (m!/key/(\d+)|/(\d+)-\d+!); [download]
In reply to Re: capture value from two patterns by Haarg in thread capture value from two patterns by vitoco