Re: question about nasty regex

2006-04-04 Thread Peter Hansen
Lawrence D'Oliveiro wrote: > In article <[EMAIL PROTECTED]>, > Paul Rubin wrote: >>"Some people, when confronted with a problem, think ``I know, I'll use >>regular expressions.'' Now they have two problems." --JWZ > > Regexes are good if you need a solution quickly, an

Re: question about nasty regex

2006-04-03 Thread Lawrence D'Oliveiro
In article <[EMAIL PROTECTED]>, Paul Rubin wrote: >"Some people, when confronted with a problem, think ``I know, I'll use >regular expressions.'' Now they have two problems." --JWZ Regexes are good if you need a solution quickly, and you're not processing large amoun

Re: question about nasty regex

2006-04-03 Thread Paul Rubin
Peter <[EMAIL PROTECTED]> writes: > >> What I mean is, I want to change, e.g.: > [snip regular expressions lesson] > > > > Whoa. That is super-duper extra cool. Thank you *very* much. "Some people, when confronted with a problem, think ``I know, I'll use regular expressions.'' Now they have two p

Re: question about nasty regex

2006-04-03 Thread Peter
Tim Chase wrote: >> What I mean is, I want to change, e.g.: [snip regular expressions lesson] > Whoa. That is super-duper extra cool. Thank you *very* much. -- http://mail.python.org/mailman/listinfo/python-list

Re: question about nasty regex

2006-04-03 Thread Tim Chase
> What I mean is, I want to change, e.g.: > > "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434, 72 > S. Ct. 394, 397, 96 L.Ed. 475 (1952)." > > into: > > "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434 (1952)." > > Generally, the beginning pattern would consist of:

question about nasty regex

2006-04-03 Thread Peter
I'm wondering if someone can tell me whether the following set of regex substitutions is possible. I want to convert parallel legal citations into single citations. What I mean is, I want to change, e.g.: "Doremus v. Board of Education of Hawthorne, 342 U.S. 429, 434, 72 S. Ct. 394, 397, 96 L.E