Re: String Pattern Matching: regex and Python regex documentation

2006-09-26 Thread Ilias Lazaridis
Steve Holden wrote: > Xah Lee wrote: ... > > This project was undertaken as a response to a challenge put forth to > > me with a $100 reward, on 2005-04-12 on comp.lang.python newsgroup. I > > never received the due reward. > > > Your reading skills must be terrible. You never received the reward >

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Steve Holden
Xah Lee wrote: > Xah Lee wrote: > « the Python regex documentation is available at: > http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» > > Jürgen Exner wrote: > «Yeah, sure, and the Perl regex documentation is available at 'perldoc > perlre'. So what? Is that anything new or

Re: String Pattern Matching: regex and Python regex documentation

2006-09-24 Thread Xah Lee
Xah Lee wrote: « the Python regex documentation is available at: http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...» Jürgen Exner wrote: «Yeah, sure, and the Perl regex documentation is available at 'perldoc perlre'. So what? Is that anything new or surprising?» It is of inter

Re: String Pattern Matching: regex and Python regex documentation

2006-09-22 Thread J�rgen Exner
Ilias Lazaridis wrote: > Xah Lee wrote: >> the Python regex documentation is available at: >> http://xahlee.org/perl-python/python_re-write/lib/module-re.html Yeah, sure, and the Perl regex documentation is available at 'perldoc perlre'. So what? Is that anything new or surprising? jue -- ht

Re: String Pattern Matching: regex and Python regex documentation

2006-09-22 Thread John Machin
Paul McGuire wrote: > "Steve Holden" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > > > > Ilias Lazardis meets Xah Lee. I just *know* we're in for trouble now ... > > > > regards > > Steve > > A sign of the End Times, perhaps? > Indeed. Armageddon outa here ;-) -- http://

Re: String Pattern Matching: regex and Python regex documentation

2006-09-22 Thread Paul McGuire
"Steve Holden" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Ilias Lazardis meets Xah Lee. I just *know* we're in for trouble now ... > > regards > Steve A sign of the End Times, perhaps? -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: String Pattern Matching: regex and Python regex documentation

2006-09-22 Thread Steve Holden
Ilias Lazaridis wrote: > [followup to c.l.py] > > Xah Lee wrote: > >>the Python regex documentation is available at: >>http://xahlee.org/perl-python/python_re-write/lib/module-re.html >> >>Note that, i've just made the terms of use clear. >> >>Also, can anyone answer what is the precise terms of

Re: String Pattern Matching: regex and Python regex documentation

2006-09-22 Thread Ilias Lazaridis
[followup to c.l.py] Xah Lee wrote: > the Python regex documentation is available at: > http://xahlee.org/perl-python/python_re-write/lib/module-re.html > > Note that, i've just made the terms of use clear. > > Also, can anyone answer what is the precise terms of license of the > official python

Re: String pattern matching

2006-04-16 Thread Jim Lewis
>You can do this with a regular expression... I tried the plain RE approach and found it no faster than my direct-coded version. Anyone have any ideas on how to code this problem elegantly without RE? My code is long and cumbersome - 200 lines! Speed is my primary concern but low LOC would be nice

Re: String pattern matching

2006-04-05 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > Thanks to all for the various good approaches. Kent's plain RE approach > seems the most straightforward - did not know that RE can handle this > situation - good to know! Thanks to Eddie Corns also who showed how to express the problem as a parsing problem. I am also

Re: String pattern matching

2006-04-05 Thread jimlewis
Thanks to all for the various good approaches. Kent's plain RE approach seems the most straightforward - did not know that RE can handle this situation - good to know! -- http://mail.python.org/mailman/listinfo/python-list

Re: String pattern matching

2006-04-03 Thread Eddie Corns
Kent Johnson <[EMAIL PROTECTED]> writes: >Eddie Corns wrote: >> If I get time I'll try to get this working in Sam Wilmott's Python pattern >> matching library. >> >> What fun! >Cool! I have to get in on the fun :-) >This program uses Sam Wilmott's library to find one solution. It is a >simple

Re: String pattern matching

2006-04-03 Thread Kent Johnson
Jim Lewis wrote: > Anyone have experience with string pattern matching? > I need a fast way to match variables to strings. Example: > > string - variables > > abcaaab - xyz > abca - xy > eeabcac - vxw > > x matches abc > y matches a > z matches aab > w maches ac > v maches ee > You

Re: String pattern matching

2006-04-03 Thread Kent Johnson
Eddie Corns wrote: > Off topic I know but I've been learning snobol pattern matching recently so I > thought I'd give this one a bash. Here is my effort: > > define('foo(str)') > &fullscan = 1 > '/abcaaab/abca/eeabcac/' '/' arb $ x arb $ y arb $ z '/' *x *y '/' > +

Re: String pattern matching

2006-04-03 Thread Eddie Corns
"Jim Lewis" <[EMAIL PROTECTED]> writes: >Anyone have experience with string pattern matching? >I need a fast way to match variables to strings. Example: >string - variables > >abcaaab - xyz >abca - xy >eeabcac - vxw >x matches abc >y matches a >z matches aab >w maches ac >v maches ee

Re: String pattern matching

2006-04-02 Thread Jim Lewis
Thanks for the interesting and detailed analysis. In my case I don't need all possible answers by rather the first "greedy" match. Seems like there might be some recursive approach. -- http://mail.python.org/mailman/listinfo/python-list

Re: String pattern matching

2006-04-01 Thread forward
Firstly sort variable expressions by its length xy = 'abca' xyz = 'abcaaab' vxw = 'eeabcac' Expand all expressions by its values except itself xy = 'abca' 'abca' z = 'abcaaab' vxw = 'eeabcac' Cut all left and right matches xy = 'abca' z = 'aab' vxw = 'eeabcac' Repeat until you