Skip to content

Commit eaa5c17

Browse files
committed
pod2markdown
1 parent 9a79ea2 commit eaa5c17

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ Data::Random::String::Matches - Generate random strings matching a regex
1212
# Generate a matching string
1313
my $str = $gen->generate();
1414
print $str; # e.g., "XYZ1234"
15-
15+
1616
# Alternation
1717
my $gen2 = Data::Random::String::Matches->new(qr/(cat|dog|bird)/);
1818
my $animal = $gen2->generate_smart(); # "cat", "dog", or "bird"
19-
19+
2020
# Backreferences
2121
my $gen3 = Data::Random::String::Matches->new(qr/(\w{3})-\1/);
2222
my $str3 = $gen3->generate_smart(); # e.g., "abc-abc"
23-
23+
2424
# Groups and quantifiers
2525
my $gen4 = Data::Random::String::Matches->new(qr/(ha){2,4}/);
2626
my $laugh = $gen4->generate_smart(); # "haha", "hahaha", or "hahahaha"
@@ -83,13 +83,13 @@ a wide range of regex features.
8383

8484
# Email-like pattern
8585
my $gen = Data::Random::String::Matches->new(qr/[a-z]+@[a-z]+\.com/);
86-
86+
8787
# API key pattern
8888
my $gen = Data::Random::String::Matches->new(qr/^AIza[0-9A-Za-z_-]{35}$/);
89-
89+
9090
# Phone number
9191
my $gen = Data::Random::String::Matches->new(qr/\d{3}-\d{3}-\d{4}/);
92-
92+
9393
# Repeated pattern
9494
my $gen = Data::Random::String::Matches->new(qr/(\w{4})-\1/);
9595

@@ -111,10 +111,12 @@ falls back to brute force if needed. Tries up to `$max_attempts` times
111111
Parses the regex and builds a matching string directly. Faster and more reliable
112112
than brute force, but may not handle all edge cases.
113113

114-
# create\_random\_string
114+
## create\_random\_string
115115

116116
For consistency with [Data::Random::String](https://metacpan.org/pod/Data%3A%3ARandom%3A%3AString).
117117

118+
print Data::Random::String->create_random_string(length => 3, regex => '\d{3}'), "\n";
119+
118120
# AUTHOR
119121

120122
Nigel Horne, `<njh at nigelhorne.com>`

0 commit comments

Comments
 (0)