反常规EX pressions生成数据 [英] Reverse regular expressions to generate data

查看:118
本文介绍了反常规EX pressions生成数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在StackOverflow的播客之一(一个人在那里讨论了数据生成测试数据块 - 无论是的#11 #12 ),杰夫提到类似反常规EX pressions,这是完全用于这个目的:给定一个正则表达式,产生一个字符串,最终将比赛表示正则表达式

In one of the StackOverflow Podcasts (the one where guys were discussing data generation for testing DBs -- either #11 or #12), Jeff mentioned something like "reverse regular expressions", which are used exactly for that purpose: given a regex, produce a string which will eventually match said regex.

什么是正确的术语,这整个概念?这是一个众所周知的概念?

What is the correct term for this whole concept? Is this a well-known concept?

推荐答案

在Perl模块字符串::随机(在CPAN)来实现的。注意到经常EX pressions的一个子集,并通过它做了随机游走。

The Perl module String::Random (in the CPAN) does this. Takes a subset of regular expressions, and does a random walk through it.

这篇关于反常规EX pressions生成数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆