I can't understand re.sub

Rick Johnson rantingrickjohnson at gmail.com
Sun Nov 29 20:12:04 EST 2015


On Sunday, November 29, 2015 at 3:37:34 PM UTC-6, Mr Zaug wrote:

> The items I'm searching for are few and they do not change. They are "CONTENT_PATH", "ENV" and "NNN". These appear on a few lines in a template file. They do not appear together on any line and they only appear once on each line. This should be simple, right?

Yes. In fact so simple that string methods and a "for loop" will suffice. Using regexps for this tasks would be like using a dump truck to haul a teaspoon of salt.




More information about the Python-list mailing list