fix file extension regex (#4510)
parent
7b2bcd12d4
commit
4768a4d882
|
@ -186,7 +186,7 @@ handle query => sub {
|
||||||
return if $req->query_lc =~ /^0x/i; # hex maybe?
|
return if $req->query_lc =~ /^0x/i; # hex maybe?
|
||||||
return if $query =~ /\d+(?:X|x)\.?$/; # websites such as 1337X
|
return if $query =~ /\d+(?:X|x)\.?$/; # websites such as 1337X
|
||||||
return if $query =~ /score$/;
|
return if $query =~ /score$/;
|
||||||
return if $query =~ /^(?:\.\w+)/; # Probably looking at file extensions
|
return if ( $query =~ /^(?:\.\w+)/ && $query !~ $number_re); # Probably looking at file extensions
|
||||||
return if $query =~ $network; # Probably want to talk about addresses, not calculations.
|
return if $query =~ $network; # Probably want to talk about addresses, not calculations.
|
||||||
return if $query =~ m/^(\+?\d{1,2}(\s|-)?|\(\d{2})?\(?\d{3,4}\)?(\s|-)?\d{3}(\s|-)?\d{3,4}(\s?x\d+)?$/; # Probably are searching for a phone number, not making a calculation
|
return if $query =~ m/^(\+?\d{1,2}(\s|-)?|\(\d{2})?\(?\d{3,4}\)?(\s|-)?\d{3}(\s|-)?\d{3,4}(\s?x\d+)?$/; # Probably are searching for a phone number, not making a calculation
|
||||||
return if $query =~ m/^\(\d+\)\s+\d+\d+/;
|
return if $query =~ m/^\(\d+\)\s+\d+\d+/;
|
||||||
|
|
|
@ -387,6 +387,12 @@ ddg_goodie_test(
|
||||||
'fact 20' => build_test(
|
'fact 20' => build_test(
|
||||||
'20!'
|
'20!'
|
||||||
),
|
),
|
||||||
|
'.32 * 100' => build_test(
|
||||||
|
'.32 * 100'
|
||||||
|
),
|
||||||
|
'.7 + .32' => build_test(
|
||||||
|
'.7 + .32'
|
||||||
|
),
|
||||||
|
|
||||||
## Trig testing
|
## Trig testing
|
||||||
'tan 45' => build_test(
|
'tan 45' => build_test(
|
||||||
|
@ -551,6 +557,8 @@ ddg_goodie_test(
|
||||||
'2/3/09' => undef,
|
'2/3/09' => undef,
|
||||||
'21/12/2012' => undef,
|
'21/12/2012' => undef,
|
||||||
'12/21/2012' => undef,
|
'12/21/2012' => undef,
|
||||||
|
'.7zip * 100' => undef,
|
||||||
|
'.tar64 + 0.3' => undef,
|
||||||
);
|
);
|
||||||
|
|
||||||
done_testing;
|
done_testing;
|
||||||
|
|
Loading…
Reference in New Issue