Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

18 lines
490 B

#!/usr/bin/perl -CAO
# via @chneukirchen
# uni PATTERN - list unicode symbols matching PATTERN
BEGIN { $SIG{'__WARN__'} = sub { } }; # silence next load
use Unicode::CharName;
my $rx = shift || die "Usage: uni PATTERN\n";
m/$rx/; # fail early on faulty regexps
while (<Unicode::CharName::DATA>) {
my ($hex, $desc) = split(/ /, $_, 2);
$char = pack("U", hex($hex));
if ($desc =~ /$rx/i || $char eq $rx || lc($hex) eq lc($rx)) {
print "$char\t$hex\t$desc";
}
}