make callsign checking more rigorous
[spider.git] / perl / DXUtil.pm
index 2c814ea33d834cbe5001eede20eecc0755059695..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
@@ -351,7 +351,7 @@ sub is_pcflag
 # check that a thing is a frequency
 sub is_freq
 {
-       return $_[0] =~ /^[\d\.]+$/;
+       return $_[0] =~ /^\d+(?:\.\d+)?$/;
 }
 
 # check that a thing is just digits