filecopy ptimelist
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
+ is_prefix
);
$!x;
}
+sub is_prefix
+{
+ return $_[0] =~ m!^(?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+)!x # basic prefix
+}
+
+
# check that a PC protocol field is valid text
sub is_pctext
{
$text =~ s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
$text = uc unpad($text);
my ($prefix) = $text =~ /\b(\w{1,4})$/;
- $text =~ s/\b\w{1,4}$// if $prefix && Prefix::extract($prefix);
+ $text =~ s/\b\w{1,4}$// if $prefix && is_prefix($prefix);
$text = substr($text, 0, $duplth) if length $text > $duplth;
$text = pack("C*", map {$_ & 127} unpack("C*", $text));
$text =~ s/[^\w]//g;