datahelix
datahelix copied to clipboard
Add regex support to faker generator
Feature Request
Description of Problem
Following on from #1584, the faker generator doesn't support arbitrary regexes.
Acceptance Criteria
- [ ] A simple regex applied to any (all) faker types, which has one or more valid results, should successfully generate values.
(Optional) Potential approaches to solution
The flaw in the original implementation was to assume the regexRepresentation was a valid regex, particularly after intersections have been applied (see here). The solution would be to either correctly intersect these regexes (which may make them harder to read for debugging), or to find a solution that invokes the automaton with the values pulled down from faker. The latter could be done by creating a new automaton for each value, and intersecting that new automaton with the old one - if this approach is used, performance should be checked carefully.