Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Hack another feature into Unicodable
Now it accepts queries like β€œU+65”
  • Loading branch information
AlexDaniel committed Dec 12, 2016
1 parent 058810b commit 2de413a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Unicodable.p6
Expand Up @@ -74,7 +74,15 @@ method process($message, $query is copy) {

my @all;

if $query ~~ /^ <+[a..zA..Z] +[0..9] +[\-\ ]>+ $/ {
if $query ~~ /^ \s* [ (.) <?{ $0[*-1].Str.NFD[0] == β€˜u’.ord | β€˜U’.ord }>
(.) <?{ $1[*-1].Str.uniname.match(/PLUS.*SIGN/) }>
(<:HexDigit>+) ]+ %% \s+ $/ {
for $2 {
my $char-desc = self.get-description(parse-base(~$_, 16));
@all.push: $char-desc;
$message.reply: $char-desc if @all < MESSAGE-LIMIT; # >;
}
} elsif $query ~~ /^ <+[a..zA..Z] +[0..9] +[\-\ ]>+ $/ {
my @words;
my @props;
for $query.words {
Expand Down

0 comments on commit 2de413a

Please sign in to comment.