import getopt, sys
import re
def replaceStringKey(key, value, result):
pattern = "(?P<first><key>"+key+"</key>[\\r\\n\s]*<string>)[\S]*(?P<second></string>)"
p = re.compile(pattern)
result = p.sub("\g<1>" + value + "\g<2>", result)
return result
def replaceIntegerKey(key, value, result):
pattern = "(?P<first><key>"+key+"</key ...
read more