Thank you in advance. - kullsuse strict; use warnings; my @str=qw(ab_xcc3 ab_xcc3_000 ok_and rajak_acc_idx rajak_acs_idx BMW_acc BMW_asc vc_ba vc_ba_002 dc_sts1 dc_sts6_005); for(@str) { my ($temp)=$_=~/^(\w{2})\_/xi; if($temp) { ($temp) =$_=~/^(\w{2}\_[a-z0-9]+)/xi; print $temp."\n"; } else { ($temp)=$_=~/^([a-z0-9]+)\_/xi; print $temp,"\n"; } } __OUTPUT___ ab_xcc3 ab_xcc3 ok_and rajak BMW vc_ba vc_ba dc_sts1 dc_sts6
In reply to Regular Expression - pattern matching by kulls
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |