Skip to content

Commit 6ddbc9d

Browse files
committed
Fixed Unicode characters
1 parent a3b5ade commit 6ddbc9d

File tree

7 files changed

+24
-11
lines changed

7 files changed

+24
-11
lines changed

Changes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Revision history for Data-Random-String-Matches
22

33
0.02
44
Added more obscure regex features
5+
Fixed Unicode characters
56

67
0.01 Mon Oct 27 21:11:53 EDT 2025
78
First draft

MANIFEST

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ t/cli.t
1616
t/eof.t
1717
t/eol.t
1818
t/generate.t
19+
t/pod-cm.t
1920
t/pod-synopsis.t
2021
t/pod.t

bin/cookbook

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Run this script to see examples of various patterns:
1313
Or use individual patterns in your own code:
1414
1515
use Data::Random::String::Matches;
16-
16+
1717
# Pick any pattern from above
1818
my $gen = Data::Random::String::Matches->new(qr/[A-Z]{3}\d{4}/);
1919
my $result = $gen->generate();

lib/Data/Random/String/Matches.pm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -723,23 +723,24 @@ sub _unicode_property_chars {
723723

724724
# Common Unicode properties
725725
if ($prop eq 'L' || $prop eq 'Letter') {
726-
# Letters
727-
return ('a' .. 'z', 'A' .. 'Z', map { chr($_) } (ord('À') .. ord('ÿ')));
726+
# Letters, skip × and ÷ which are symbols
727+
return ('a' .. 'z', 'A' .. 'Z', map { chr($_) } ((ord'À')..ord('Ö'), ord('Ø')..ord('ö'), ord('ø')..ord('ÿ')));
728728
} elsif ($prop eq 'N' || $prop eq 'Number') {
729729
# Numbers
730-
return ('0' .. '9', map { chr($_) } (ord('').. ord('')));
730+
# return ('0' .. '9', map { chr($_) } (ord('①').. ord('⑳')));
731+
return ('0' .. '9');
731732
} elsif ($prop eq 'Lu' || $prop eq 'Uppercase_Letter') {
732-
# Uppercase letters
733-
return ('A' .. 'Z', map { chr($_) } (ord('À') .. ord('Þ')));
733+
# Uppercase letters, skip × which is not a letter
734+
return ('A' .. 'Z', map { chr($_) } (ord('À') .. ord('Ö'), ord('ø') .. ord('Þ')));
734735
} elsif ($prop eq 'Ll' || $prop eq 'Lowercase_Letter') {
735-
# Lowercase letters
736-
return ('a' .. 'z', map { chr($_) } (ord('à') .. ord('ÿ')));
736+
# Lowercase letters, skip ÷ which is not a letter
737+
return ('a' .. 'z', map { chr($_) } (ord('à') .. ord('ö'), ord('ø') .. ord('ÿ')));
737738
} elsif ($prop eq 'P' || $prop eq 'Punctuation') {
738739
# Punctuation
739740
return ('.', ',', '!', '?', ';', ':', '-', '', '');
740741
} elsif ($prop eq 'S' || $prop eq 'Symbol') {
741742
# Symbols
742-
return ('$', '', '£', '¥', '©', '®', '', '°', '±');
743+
return ('$', '', '£', '¥', '©', '®', '', '°', '±', '×', '÷');
743744
} elsif ($prop eq 'Z' || $prop eq 'Separator') {
744745
# Separators
745746
return (' ', "\t", "\n");

t/advanced-features.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use warnings;
55

66
use open ':std', ':encoding(UTF-8)';
77

8-
use Test::DescribeMe qw(extended); # These can fail at the moment. Disable while debugging
8+
# use Test::DescribeMe qw(extended); # These can fail at the moment. Disable while debugging
99
use Test::Most;
1010

1111
use_ok('Data::Random::String::Matches');

t/advanced_regex.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use warnings;
55

66
use utf8;
77
use Test::Most;
8-
use Test::DescribeMe qw(extended); # These can fail at the moment. Disable while debugging
8+
# use Test::DescribeMe qw(extended); # These can fail at the moment. Disable while debugging
99

1010
use open ':std', ':encoding(UTF-8)';
1111

t/pod-cm.t

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/perl -w
2+
3+
use strict;
4+
use warnings;
5+
6+
use Test::DescribeMe qw(author);
7+
use Test::Needs 'Test::Pod::Spelling::CommonMistakes';
8+
9+
Test::Pod::Spelling::CommonMistakes->import();
10+
all_pod_files_ok();

0 commit comments

Comments
 (0)