"reverse" regular expression with JavaScript(node.js)

Viewed 741

With regular expression like this /\w/ I can match strings like a, q. Is there any idiomatic way to generate all the strings which match some regex in JS?

Don't think about infinite cases. I just want to describe some sets of possible symbols briefly.

something meaningful instead of

var s = ' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'

1 Answers
Related