Chas. Owens wrote:
> Is it safe to say
>
> use Unicode::Digits qw/digits_to_int/;
>
> my @digits;
> for (split "\n", require "unicore/lib/gc_sc/Digit.pl") {
> my ($s, $e) = map hex, split;
> for (my $ord = $s; $ord <= $e; $ord++) {
> my $chr = chr $ord;
> push @{$digits[digits_to_int $chr]}, $chr;
> }
> }
>
> for my $i (0 .. 9) {
> my $re = join '', "[", @{$digits[$i]}, "]";
> $digits[$i] = qr/$re/;
> }
>
> Or is unicore/lib/gc_sc/Digit.pl an undocumented feature likely to change?
>
Any file in unicore/lib is subject to change or removal, as the comments
being added to each in 10.1 indicate. You could use the file
To/Digit.pl which is also undocumented, but I know of no plans to change it.
But, I'm working on a patch which will expose the Numeric_Value
property, so that it becomes trivial to say /\p{nv=3}/ to accomplish
what you said you want.
Thread Previous
|
Thread Next