M
mike
Hi,
I have the following string that I need to check the following:
CXP_1212232_R1A01
It starts with CXP and has seven digits after first underscore and
that after second underscore it begins with an cap R followed by a
cap letter and a digit. Then the last digits in the string can be any
number of digits ( it is like an index).
I have ttried the following regexp:
if($name !~ m/^[CXP]_\d{7}_[R]{1}\d{1}[A-Z]{1}\d+/){
print "String should be something like, CXP_1233445_R1A01\n";
print "You had the following, $name\n";
exit 1;
}
I tried the following,CXP_1212232_R1A01, but I seem to go into the if
statement. However this should be an acceptable name. Any hints?
br,
//mike
I have the following string that I need to check the following:
CXP_1212232_R1A01
It starts with CXP and has seven digits after first underscore and
that after second underscore it begins with an cap R followed by a
cap letter and a digit. Then the last digits in the string can be any
number of digits ( it is like an index).
I have ttried the following regexp:
if($name !~ m/^[CXP]_\d{7}_[R]{1}\d{1}[A-Z]{1}\d+/){
print "String should be something like, CXP_1233445_R1A01\n";
print "You had the following, $name\n";
exit 1;
}
I tried the following,CXP_1212232_R1A01, but I seem to go into the if
statement. However this should be an acceptable name. Any hints?
br,
//mike