s s, , "", "thinotring".
, , , , , backreference. 1 is a. , : \1.
, , , , - :
re.sub(r"(?<=s ).*?(?= s)", "no", "this is a string")
(?<=s ) : , s, .
(?= s), , s .
, lookbehind Python . , , , ... !
re.sub(r"(s ).*?( s)", r"\1no\2", "this is a string")
, , , . , HTML . . SO "regex html", , .
:
re.sub(r"(<a.*?href=['"])((?!http).*?['"].*?>)", r'\1http:
. .