Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
112
rated 0 times [  118] [ 6]  / answers: 1 / hits: 16554  / 11 Years ago, tue, february 4, 2014, 12:00:00

I think it can be done by generating strings using brute force and then try to match them to the supplied regex and printing if match.



But is there a better way to do this?



Regex are used to test if a string matches a pattern.
I am aware of that. I thought it would be interesting to do it the way around.


More From » regex

 Answers
2

If you're using JavaScript, there's Randexp which generates random strings that match a given regex.



Releases for browser


[#72732] Monday, February 3, 2014, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
payton

Total Points: 307
Total Questions: 96
Total Answers: 83

Location: Saint Vincent and the Grenadines
Member since Sat, Sep 11, 2021
3 Years ago
;