in reply to Re^3: help with regex
in thread help with regex

The following would be better:
if (/string=\"(\d+)\"|static-address\/(.*?)\"/) { my $id = defined($1) ? $1 : $2;

And then there's this:

if (/string=\"(\d+)\"/ || /static-address\/(.*?)\"/) { my $id = $1;