Generating strings from regular expression in JavaScript

javascript, regex

Solution

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

Releases for browser

Problem

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.

Original source

Related problems