thebjorn wrote:
> On Sep 29, 5:22 pm, [EMAIL PROTECTED] wrote:
>   
>> I wrote the following simple program to loop through our help files
>> and fix some errors (in case you can't see the subtle RE search that's
>> happening, we're replacing spaces in bookmarks with _'s)
>> (...)
>>     
>
> Ugh, that was entirely too many regexps for my taste :-)
>
> How about something like:
>
> def attr_ndx_iter(txt, attribute):
>     (...)
> def substr_map(txt, indices, fn):
>     (...)
> def transform(s):
>     (...)
> def zap_spaces(txt, *attributes):
>     (...)
> def mass_replace():
>     (...)

Oh yeah, now it's clear as mud.
I do think that the whole program shouldn't take more than 10 lines of 
code using one sensible regex (impossible to define without knowing the 
real input and output formats).
And (sorry to tell) I'm convinced this is a problem for regexes, in 
spite of anybody's personal taste.

Pablo
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to