Help language development. Donate to The Perl Foundation

P5quotemeta cpan:ELIZABETH last updated on 2019-11-10

char-finder.pl
#!/usr/bin/env perl

use 5.020;
use Number::Range;
use Data::Dumper;

my $r = Number::Range->new;

for ( 0 .. 0xFFFFF ) {
    next if chr eq quotemeta chr;
    $r->addrange($_);
}

print "<[\n";
for ( $r->rangeList ) {
    my ( $s, $e ) = @$_;
    unless ( defined $e ) {
        say "    \\x[" . sprintf('%x', $s) . "]";
        next;
    }

    say "    \\x[" . sprintf('%x', $s) . "]..\\x[" . sprintf('%x', $e) . "]";
}
print "]>\n";