I am trying to convert the SED code below to Python3.3. How do I reference the value of the first and second wildcards so that I can put the variable values in the "replace" portion of the code?
SED (this works): export DATA=$(echo "$DATA" | sed -r -e "s|^<substitute find=\"(.*)\" replace=\"(.*)\"/> $|\1(>=>)\2|gI") Python3.3 (attempted): DATA = re.sub('^<substitute find=\".*\" replace=\".*\"/>$', '\1(>=>)\2', DATA, flags=re.I) Thank you.
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor