7 my ($self, $line) = @_;
8 my @list = split /\s+/, $line; # split the line up
14 my ($fromday, $today);
22 my ($doqsl, $doiota, $doqra);
24 while ($f = shift @list) { # next field
25 # print "f: $f list: ", join(',', @list), "\n";
27 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count?
28 next if $from && $to > $from;
31 ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
34 if (lc $f eq 'on' && $list[0]) { # is it freq range?
36 my @r = split '/', lc $list[0];
37 # print "r0: $r[0] r1: $r[1]\n";
38 my @fr = Bands::get_freq($r[0], $r[1]);
39 if (@fr) { # yup, get rid of extranous param
40 # print "freq: ", join(',', @fr), "\n";
42 push @freq, @fr; # add these to the list
46 if (lc $f eq 'day' && $list[0]) {
48 ($fromday, $today) = split '-', shift(@list);
51 if (lc $f eq 'info' && $list[0]) {
56 if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) {
57 # print "got spotter\n";
58 $spotter = uc shift @list;
65 if (lc $f eq 'iota') {
69 if ($list[0] && (($a, $b) = $list[0] =~ /(AF|AN|NA|SA|EU|AS|OC)-?(\d?\d\d)/oi)) {
71 $doiota = "\\b$a\[\-\ \]\?$b\\b";
74 $doiota = '\b(IOTA|(AF|AN|NA|SA|EU|AS|OC)[- ]?\d?\d\d)\b' unless $doiota;
78 $doqra = uc shift @list if $list[0] =~ /[A-Z][A-Z]\d\d/oi;
79 $doqra = '\b([A-Z][A-Z]\d\d|[A-Z][A-Z]\d\d[A-Z][A-Z])\b' unless $doqra;
87 # first deal with the prefix
89 $pre .= '*' unless $pre =~ /[\*\?\[]/o;
90 $pre = shellregex($pre);
91 $expr = "\$f1 =~ m{$pre}";
96 # now deal with any frequencies specified
98 $expr .= ($expr) ? " && (" : "(";
99 $hint .= ($hint) ? " && (" : "(";
101 for ($i = 0; $i < @freq; $i += 2) {
102 $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||";
103 my $r = Spot::ftor($freq[$i], $freq[$i+1]);
104 $hint .= "m{$r\\.} ||" if $r;
106 chop $expr; chop $expr;
107 chop $hint; chop $hint;
114 $expr .= " && " if $expr;
115 $info =~ s{(.)}{"\Q$1"}ge;
116 $expr .= "\$f3 =~ m{$info}i";
117 $hint .= " && " if $hint;
118 $hint .= "m{$info}i";
123 $expr .= " && " if $expr;
124 $spotter .= '*' unless $spotter =~ /[\*\?\[]/o;
125 $spotter = shellregex($spotter);
126 $expr .= "\$f4 =~ m{\U$spotter}";
127 $hint .= " && " if $hint;
128 $spotter =~ s/[\^\$]//g;
129 $hint .= "m{\U$spotter}";
134 $expr .= " && " if $expr;
135 $expr .= "\$f3 =~ m{QSL|VIA}i";
136 $hint .= " && " if $hint;
137 $hint .= "m{QSL|VIA}i";
142 $expr .= " && " if $expr;
143 $expr .= "\$f3 =~ m{$doiota}i";
144 $hint .= " && " if $hint;
145 $hint .= "m{$doiota}i";
150 $expr .= " && " if $expr;
151 $expr .= "\$f3 =~ m{$doqra}i";
152 $hint .= " && " if $hint;
153 $hint .= "m{$doqra}io";
156 #print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
159 my @res = Spot::search($expr, $fromday, $today, $from, $to, $hint);
162 foreach $ref (@res) {
163 push @out, Spot::formatl(@$ref);