Backreferences in python ?

Pankaj pankajgode at gmail.com
Mon Jan 23 18:44:13 CET 2006


I got my answer

if ( m != None ) :
         subStrPattern1_hasInitialization = m.group(1)


          subStrPattern2_hasRestTillEnd = m.group(2)

         str = subStrPattern1_hasInitialization  +
subStrPattern2_hasRestTillEnd
        strToReplace = "for(" +  pattern + str


This gave me my solution

But to tell u, i have not got that, why i should concatenate and then
only place it . while i was trying the same thing by concatenation it
straight to replace string, it was not working

Any body has reasons ???




More information about the Python-list mailing list