sub is_callsign
{
return $_[0] =~ m!^
- (?:(?:[A-Z]{1,2}\d* | \d[A-Z]{1,2}\d*)/)? # out of area prefix /
- (?:[A-Z]{1,2}\d+ | \d[A-Z]{1,2}\d+)? # main prefix one
- [A-Z]{1,5} # callsign letters
- (?:-(?:\d{1,2}|\#))? # - nn possibly (eg G8BPQ-8) or -# (an RBN spot)
- (?:/[0-9A-Z]{1,7})? # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly
+ (?:\d?[A-Z]{1,2}\d*/)? # out of area prefix /
+ (?:\d?[A-Z]{1,2}\d+) # main prefix one (required)
+ [A-Z]{1,5} # callsign letters (required)
+ (?:-(?:\d{1,2}|\#))? # - nn possibly (eg G8BPQ-8) or -# (an RBN spot)
+ (?:/[0-9A-Z]{1,7})? # / another prefix, callsign or special label (including /MM, /P as well as /EURO or /LGT) possibly
$!x;
# longest callign allowed is 1X11/1Y11XXXXX-11/XXXXXXX
# is it an ip address?
sub is_ipaddr
{
- return $_[0] =~ /^\d+\.\d+\.\d+\.\d+$/ || $_[0] =~ /^[0-9a-f:]+$/;
+ return $_[0] =~ /^\d+\.\d+\.\d+\.\d+$/ || $_[0] =~ /^[0-9a-f:,]+$/;
}
# insert an item into a list if it isn't already there returns 1 if there 0 if not
# examples:-
#
# watchdbg g1tlh # watch everything g1tlh does
-# watchdbg 2 PCPROT # watch all PCPROT messages + up to 2 lines before
+# watchdbg -2 PCPROT # watch all PCPROT messages + up to 2 lines before
# watchdbg gb7baa gb7djk # watch the conversation between BAA and DJK
#
# seek to end of file
$fh->seek(0, 2);
for (;;) {
- my $line = <$fh>;
+ my $line = $fh->getline;
if ($line) {
if ($exp) {
push @prev, $line;