i got an string that might look like this
\"myFunc(\'element\',\'node\',\'elementVersion\',\'ext\',12,0,0)\"
i\'m currently checking for va
Read the documentation: re.sub
returns a copy of the string where every occurrence of the entire pattern is replaced with the replacement. It cannot in any case modify the original string, because Python strings are immutable.
Try using look-ahead and look-behind assertions to construct a regex that only matches the element itself:
myRe = re.compile(r"(?<=myFunc\(.+?\,.+?\,)(.+?)(?=\,.+?\,.+?\,.+?\,.+?\))")