Regex icon indicating copy to clipboard operation
Regex copied to clipboard

String generation does not work as expected with negative character classes

Open blmage opened this issue 6 years ago • 1 comments

The generation rule for negative character classes does not work as expected: instead of generating a character which does not belong to the character class, it generates a printable ASCII character that is not part of the random characters generated for the class children.

Not quite sure how to fix this though, would you have any pointer as to where to start? Thanks!

blmage avatar Dec 09 '19 18:12 blmage

After having given it more thought, each element of the AST should probably return a range (or set of ranges) of the characters that it can match, knowing that in the case of alternations and classes, this would require applying some operation to their children's ranges (union or complement). I'll take a stab at it if I can find some time!

blmage avatar Dec 14 '19 15:12 blmage