in reply to Regular expression question
Hi megaurav2002, if I understood your question correctly then the following would will help you.
use strict; use warnings; my @array = qw(id_1_1 id_2); for (@array){ print "$1\n" if (m/id\_(\d+)(?!\_)/); } __END__ Output: ------ 2
Also look into How (Not) To Ask A Question
Regards,
Velusamy R.
|
---|