Fri Jul 03, 2020 8:28 pm
Login Register Lost Password? Contact Us


Using REGEX in reverse?

Questions around writing code and queries

Thu Nov 28, 2019 9:10 am Change Time Zone

Hi Community,

Has anyone written a 'reverse' Regular expression generator?

Normal REGEX takes a candidate textual string and checks that is conforms to some expression.

Has anyone generated test data by supplying a regular expression and returning some text that conforms to said input regular expression?

May have to return a DATASET of text as with ORs (|) there are multiple paths through the regular expression.

Weird question perhaps, well I'll just put it out there.

Yours
Allan
Allan
 
Posts: 428
Joined: Sat Oct 01, 2011 7:26 pm

Mon Dec 23, 2019 7:05 am Change Time Zone

Allan,

No, I've never heard of any code that generates test data from RegEx.

I did write a pretty complex test data generator a while back that I could let you have a look at to see if it might meet your needs. PM me if you're interested.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1545
Joined: Wed Oct 26, 2011 7:40 pm

Mon Dec 30, 2019 9:05 am Change Time Zone

No, it's ok Richard. As I said it's a wacky idea, but intriguing.
If one could do it, it would make generating test data SSSSSOOOOO much easier.

Cheers

Allan
Allan
 
Posts: 428
Joined: Sat Oct 01, 2011 7:26 pm

Mon Dec 30, 2019 9:11 am Change Time Zone

Richard,

Your comment:
I did write a pretty complex test data generator a while back that I could let you have a look

This is precisely the job assigned to me!
I never like re-inventing the wheel, unfortunately I've gone a fare way down my implementation route, (which also has to service as a validator of incoming test data).

I'll ping you the proposal I'm working to. (needs updating ha ha).

Cheers

Allan
Allan
 
Posts: 428
Joined: Sat Oct 01, 2011 7:26 pm

Tue Dec 31, 2019 4:47 am Change Time Zone

Allan,

I emailed you a .mod file containing my test data generator code. I built a pretty generic system where the only requirements were to be able to generate any number records with any number of fields of any simple data type, with or without a standard distribution curve for the generated data (Gaussian, random, Pareto, etc.). An additional challenge was to make the "random" data duplicable.

HTH,

Richard
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1545
Joined: Wed Oct 26, 2011 7:40 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 0 guests