S
sivga
Hi
how do i match a string exactly for eg
$stringid is pid-3-1
i need to match pid-[0-9*]-[0-9*] and not anything like pid-3-1-1 or
pid-3 ,pid-3-1-1-1 etc
allowed possibilities are
pid-any no of digits-any no of digits
this is the code i have but does not seem to work
if ($stringid eq 'pid-[0-9*]-[0-9*]' ) {
print " pid is correct ...... \n";
}else {
print " pid does not exist \n";
exit 1;
}
how do i match a string exactly for eg
$stringid is pid-3-1
i need to match pid-[0-9*]-[0-9*] and not anything like pid-3-1-1 or
pid-3 ,pid-3-1-1-1 etc
allowed possibilities are
pid-any no of digits-any no of digits
this is the code i have but does not seem to work
if ($stringid eq 'pid-[0-9*]-[0-9*]' ) {
print " pid is correct ...... \n";
}else {
print " pid does not exist \n";
exit 1;
}