7 my ($self, $line) = @_;
8 my @list = split /\s+/, $line; # split the line up
14 my ($fromday, $today);
21 my ($doqsl, $doiota, $doqra);
23 while ($f = shift @list) { # next field
24 # print "f: $f list: ", join(',', @list), "\n";
26 ($from, $to) = $f =~ /^(\d+)-(\d+)$/o; # is it a from -> to count?
27 next if $from && $to > $from;
30 ($to) = $f =~ /^(\d+)$/o if !$to; # is it a to count?
33 if (lc $f eq 'on' && $list[0]) { # is it freq range?
35 my @r = split '/', $list[0];
36 # print "r0: $r[0] r1: $r[1]\n";
37 my @fr = Bands::get_freq($r[0], $r[1]);
38 if (@fr) { # yup, get rid of extranous param
39 # print "freq: ", join(',', @fr), "\n";
41 push @freq, @fr; # add these to the list
45 if (lc $f eq 'day' && $list[0]) {
47 ($fromday, $today) = split '-', shift(@list);
50 if (lc $f eq 'info' && $list[0]) {
55 if ((lc $f eq 'spotter' || lc $f eq 'by') && $list[0]) {
56 # print "got spotter\n";
57 $spotter = uc shift @list;
64 if (lc $f eq 'iota') {
68 if ($list[0] && (($a, $b) = $list[0] =~ /(AF|AN|NA|SA|EU|AS|OC)-?(\d\d\d)/oi)) {
70 $doiota = "\\b$a\[\-\ \]\?$b\\b";
73 $doiota = '\b(IOTA|(AF|AN|NA|SA|EU|AS|OC)[- ]?\d\d\d)\b' unless $doiota;
77 $doqra = uc shift @list if $list[0] =~ /[A-Z][A-Z]\d\d/oi;
78 $doqra = '\b([A-Z][A-Z]\d\d|[A-Z][A-Z]\d\d[A-Z][A-Z])\b' unless $doqra;
86 # first deal with the prefix
88 $pre .= '*' unless $pre =~ /[\*\?\[]/o;
89 $pre = shellregex($pre);
90 $expr = "\$f1 =~ m{$pre}o";
92 $expr = "1"; # match anything
95 # now deal with any frequencies specified
97 $expr .= ($expr) ? " && (" : "(";
99 for ($i = 0; $i < @freq; $i += 2) {
100 $expr .= "(\$f0 >= $freq[$i] && \$f0 <= $freq[$i+1]) ||";
109 $expr .= " && " if $expr;
110 $info =~ s{(.)}{"\Q$1"}ge;
111 $expr .= "\$f3 =~ m{$info}io";
116 $expr .= " && " if $expr;
117 $spotter = shellregex($spotter);
118 $expr .= "\$f4 =~ m{$spotter}o";
123 $expr .= " && " if $expr;
124 $expr .= "\$f3 =~ m{(QSL|VIA)}io";
129 $expr .= " && " if $expr;
130 $expr .= "\$f3 =~ m{$doiota}io";
135 $expr .= " && " if $expr;
136 $expr .= "\$f3 =~ m{$doqra}io";
139 #print "expr: $expr from: $from to: $to fromday: $fromday today: $today\n";
142 my @res = Spot::search($expr, $fromday, $today, $from, $to);
145 foreach $ref (@res) {
147 push @out, Spot::formatl(@dx);