diff --git a/lib/DDG/Goodie/Base.pm b/lib/DDG/Goodie/Base.pm index f2f49e86d..5fa9be334 100644 --- a/lib/DDG/Goodie/Base.pm +++ b/lib/DDG/Goodie/Base.pm @@ -31,7 +31,7 @@ my $prefix_keys = join '|', keys %prefix_map; triggers any => 'base', keys %base_map; -handle query_clean => sub { +handle query_lc => sub { return unless /^(?$prefix_keys)?(?[0-9A-Za-z]+)\s*((?:(?:in|as)\s+)?(?:(?$map_keys)|(?:base\s*(?[0-9]+)))\s+)?(?:(?:in|as|to)\s+)?(?:(?$map_keys)|(?:base\s*(?[0-9]+)))$/; my $input = uc $+{'inp'}; # uc is necessary as Int2Base doesnt support lowercase my $from_base = 10; diff --git a/t/Base.t b/t/Base.t index fb7685eef..873cc4ad3 100644 --- a/t/Base.t +++ b/t/Base.t @@ -47,7 +47,8 @@ ddg_goodie_test( 'HELLOWORLD as base 33 to dec'=> build_test('HELLOWORLD', 33, 10, '809608041709942'), '0xFF in binary to decimal' => undef, '0b1111 in hex as binary' => undef, - '0xFF in binary hex as decimal' => undef + '0xFF in binary hex as decimal' => undef, + '0.01% in decimal' => undef ); done_testing;