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.
In reply to Re: Regular expression question
by Samy_rio
in thread Regular expression question
by megaurav2002
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |