in reply to expanding regexps, question with no answer yet
I don't know of any module which does that - for a very simple reason, the number of possibilites quickly explode to very large numbers.
Let's have a closer look - disregarding any Unicode issues, that would render things immediately impossible - at e.g. this regex /a/. So we are looking for a string that contains the letter 'a'. Let the maxlen be 3, a very short string.
We start out with all possible three letter strings. Every byte of the string can have (in principle) 256 different values. This gives 256**3 = 16,777,216 different strings with 3 bytes each. In turn this eats up at least (in reality it's more) 50,331,648 bytes of memory, that's nearly 50 MB! For a three letter string. Furthermore the amount of strings you will get back is huge as well - and what would you do with them ...
Ok, the problem itself is still interesting but you have to turn it down a bit - then it makes a very nice programming problem:
So go ahead and try to write the little program - and feel free to ask here if you come across some problems.
-- Hofmator
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: expanding regexps, question with no answer yet
by Everlasting God (Beadle) on Aug 17, 2001 at 18:58 UTC | |
by Hofmator (Curate) on Aug 17, 2001 at 19:10 UTC | |
by Everlasting God (Beadle) on Aug 17, 2001 at 19:21 UTC |