I have some random text like:
>>>text= \
"""import sys
n = int(sys.argv[1]) ;;print "blbalbalbalabllalbaa"
replace me i in range(1,n) {print "numbers:";;replace me j in range(1,3) {print j} ;;print i ;;replace me k in range(1,3) {print k} ;;print "end!"}
replace me n < 5 {print n ;;print "youragenious"}
"""
i'd like to change all ";;" to ";;____" or ";;fourrandomthings" or whatever but only inside of {...}
i tried:
>>> p=re.compile(' {([^;]*);;([^;]*)}')
>>> print p.sub(r' {\1;; \2}',text)
import sys
n = int(sys.argv[1]) ;;print "blbalbalbalabllalbaa"
replace me i in range(1,n) {print "numbers:";; replace me j in range(1,3) {print j} ;;print i ;;replace me k in range(1,3) {print k} ;; print "end!"}
replace me n < 5 {print n ;; print "youragenious"}
it's still not what i need...please help