X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?p=spider.git;a=blobdiff_plain;f=perl%2FDXUtil.pm;h=705e5cc6c6eb02bdae3acf8eb003889182645205;hp=c633413e7bfa2a0fdef19fde66645dffcef91ce6;hb=e07645cec07ba739a20cc009d7dd138c962b66eb;hpb=90a05bee744c82d66ffdd0a0548b2ae97d7dfb56 diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index c633413e..705e5cc6 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -341,7 +341,13 @@ 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]{1,2}\d+)[A-Z]{1,3}(?:-\d{1,2}|\/(?:[A-Z]{1,2}\d{0,2}|\d[A-Z]\d{0,2}))?$/; + return $_[0] =~ m!^(?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+) # basic prefix + (?:/(?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+))? # / another one (possibly) + [A-Z]{1,3} # callsign letters + (?:/(?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+))? # / another prefix possibly + (?:/[0-9A-Z]{1,2})? # /0-9A-Z+ possibly + (?:-\d{1,2})? # - nn possibly + $!x; } # check that a PC protocol field is valid text