You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`pattern_info` analyzes a regular expression to produce a structured summary of its characteristics,
189
+
including estimated string lengths, detected features, and an overall complexity rating.
190
+
It first calls `_estimate_length` to heuristically compute the minimum and maximum possible lengths of strings matching the pattern by scanning for literals,
191
+
character classes, and quantifiers.
192
+
It then detects the presence of advanced regex constructions such as alternation, lookahead or lookbehind assertions, named groups, and Unicode properties, storing them in a feature hash.
193
+
Finally, it calculates a rough "complexity" classification based on pattern length and detected features-returning a hash reference that describes the regex's structure, estimated lengths, and complexity level.
194
+
167
195
## create\_random\_string
168
196
169
197
For consistency with [Data::Random::String](https://metacpan.org/pod/Data%3A%3ARandom%3A%3AString).
@@ -174,10 +202,11 @@ For consistency with [Data::Random::String](https://metacpan.org/pod/Data%3A%3AR
174
202
175
203
Nigel Horne, `<njh at nigelhorne.com>`
176
204
177
-
# LICENSE
205
+
# SEE ALSO
178
206
179
-
This is free software; you can redistribute it and/or modify it under
180
-
the same terms as Perl itself.
207
+
- Test coverage report: [https://nigelhorne.github.io/Data-Random-String-Matches/coverage/](https://nigelhorne.github.io/Data-Random-String-Matches/coverage/)
C<pattern_info> analyzes a regular expression to produce a structured summary of its characteristics,
407
+
including estimated string lengths, detected features, and an overall complexity rating.
408
+
It first calls C<_estimate_length> to heuristically compute the minimum and maximum possible lengths of strings matching the pattern by scanning for literals,
409
+
character classes, and quantifiers.
410
+
It then detects the presence of advanced regex constructions such as alternation, lookahead or lookbehind assertions, named groups, and Unicode properties, storing them in a feature hash.
411
+
Finally, it calculates a rough "complexity" classification based on pattern length and detected features-returning a hash reference that describes the regex's structure, estimated lengths, and complexity level.
0 commit comments