0
我希望能够采用正则表达式并使用python假设库生成符合数据。例如给定一个正则表达式从正则表达式生成字符串数据
regex = re.compile('[a-zA-Z]')
这将匹配任何英文字母字符。这可能是一个示例生成器。
import hypothesis
import string
hypothesis.strategies.text(alphabet=string.ascii_letters)
但理想我想创建一个字符串,将匹配在传递的任何正则表达式。