if ($string =~/(\w+)(_RVCT)/)There is no need for the capturing parentheses around _RVCT:
use warnings; use strict; my $string = "Viood_ram_shiva_RVCT22"; if ($string =~ /(\w+)_RVCT/) { print "The file name is $1. "; }
In reply to Re^2: Extract Sub String
by toolic
in thread Extract Sub String
by gvinu4u
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |