Skip to content

Conversation

@ethan-wrasman-pkware
Copy link

@ethan-wrasman-pkware ethan-wrasman-pkware commented Sep 11, 2025

With how the termination condition was being calculated, it was weighed heavily towards the longest length when no max length is provided. A maximum length is now calculated using DFS for any finite pattern and a target length is calculated uniformly.

  • Include GitHub Secrets

NOTES.md Outdated
@@ -0,0 +1,12 @@
We want to try to match the length of the generated regex with a predefined length of a uniform distribution. Note that this would theoretically only really make the length distribution even, not necessarily the regexes generated.

This comment was marked as resolved.

Arguments.of("123a*", 5, 10),
Arguments.of("a*123", 5, 20),
// Does not pass test, but isn't a terrible result (biases the middle lengths over the bounds)
// Arguments.of("(abcde){1,5}", 5, 25),

This comment was marked as resolved.

return returnValue;
}

// TODO Docs. Discard current match if its > maxLength (indicates invalid match), discard match if its not in bounds, take the match that is closest to target.

This comment was marked as resolved.

With how the termination condition was being calculated, it was weighed heavily towards the longest length when no max length is provided. A maximum length is now calculated using DFS for any finite pattern.
@ethan-wrasman-pkware ethan-wrasman-pkware merged commit 94145a3 into master Sep 25, 2025
2 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants