Skip to content

Commit a1b9776

Browse files
committed
Adds regex length range analysis
Adds a new feature to analyze regular expressions and determine the minimum and maximum possible lengths of strings that match the regex. This is achieved by implementing a `LengthRangeNodeVisitor` that traverses the regex's AST and calculates the length range. This information is useful for input validation and optimization.
1 parent af57e7e commit a1b9776

File tree

4 files changed

+521
-1
lines changed

4 files changed

+521
-1
lines changed

rector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
__DIR__.'/tests/Unit/Bridge/Symfony/Command/RegexParserValidateCommandTest.php',
3636
__DIR__.'/tests/Unit/Bridge/Symfony/RegexParserBundleTest.php',
3737
__DIR__.'/tests/Unit/ValidationResultTest.php',
38+
__DIR__.'/tests/NodeVisitor/LengthRangeNodeVisitorTest.php',
3839
]);
3940

4041
// $rectorConfig->import(__DIR__.'/config/rector/regex-parser.php');

0 commit comments

Comments
 (0)