Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
> > Please check out this example on the pyparsing wiki, > invRegex.py:http://pyparsing.wikispaces.com/file/view/invRegex.py.  This code > implements a generator that returns successive matching strings for > the given regex.  Running it, I see that you actually have a typo in > your example. > >

Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
Feb 7, 10:38 am, Steve Holden wrote: > hzh...@gmail.com wrote: > >> And I really don't see how simple enumeration of range(2^2048) breaks > >> RSA-2048, since that problem requires you to find two factors which, > >> when multiplied together, give that specific

Re: How to print all expressions that match a regular expression

2010-02-07 Thread hzh...@gmail.com
> > And I really don't see how simple enumeration of range(2^2048) breaks > RSA-2048, since that problem requires you to find two factors which, > when multiplied together, give that specific value. > I can tell you why is that. RSA-2048 has a composite of length less than 2^2048, which is a prod

Re: How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
> > So it seems we both misunderstood the problem. > > I didn't read the top level article until now, and reading it, I can't make > sense of it. > Seems that you should read the whole thing before making a post, or else you cannot know what we are talking about. Steven doesn't misunderstand me.

Re: How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
Thanks for your reply. So there isn't such a routine just because some of the regular expressions cannot be enumerated. However, some of them can be enumerated. I guess I have to write a function myself. Zhuo On Feb 6, 5:23 pm, Roy Smith wrote: > In article > , > > > >

How to print all expressions that match a regular expression

2010-02-06 Thread hzh...@gmail.com
Hi, I am a fresh man with python. I know there is regular expressions in Python. What I need is that given a particular regular expression, output all the matches. For example, given “[1|2|3]{2}” as the regular expression, the program should output all 9 matches, i.e., "11 12 13 21 22 23 31 32 33"