开发者

Get example matches that fit a regular expression [duplicate]

开发者 https://www.devze.com 2022-12-18 13:39 出处:网络
This question already has answers here: Closed 12 years ago. Possible Duplicates: Random Text generator based on regex
This question already has answers here: Closed 12 years ago.

Possible Duplicates:

Random Text generator based on regex

Using Regex to generate Strings rather than match them

Hi, I need a matches generator for my regular expressions. E.g. for input like:

[A-Z]+[0-9]?

I get output:

FDLJUIOAF
LFDSJKHI8
B
IJKL5

And so on. I need this to show client what commands ar开发者_高级运维e currently supported so he can tell me what he wants to be added.

Does anyone know if there are such services?


Problem is - for some expressions you can have an unlimited number of strings that match it. You could brute-force all strings of length 5, but that is very computationally intensive already. I am of the opinion that a human can do a better REPRESENTATIVE job.


Here's a microsoft tool which does exactly this job:

msdn.microsoft.com : The regular expression generator

Note that the dialect may be different from the one you are using - check carefully.

0

精彩评论

暂无评论...
验证码 换一张
取 消