make callsign checking more rigorous
[spider.git] / perl / DXUtil.pm
index 9d475ed89c8f2f17713b3aabdc9aa6c79d93d4df..018a404a6249baa43fe2987ff24520c25cf33d59 100644 (file)
@@ -333,7 +333,7 @@ sub unpad
 # check that a field only has callsign characters in it
 sub is_callsign
 {
-       return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]+(?:-\d{1,2}|\/[A-Z0-9]+)?$/;
+       return $_[0] =~ /^(?:[A-Z]{1,2}\d+|\d[A-Z]\d+)[A-Z]{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2}))?$/;
 }
 
 # check that a PC protocol field is valid text