0
내가추가 문자열
link = 'branch=;deps=;date=;rev=;days=1;user='
date = "10.12.2016"
re.sub(r'(.*)(date=[^;]*)(.*)','\\1\\2'+date+'\\3',link)
내가
'branch=;deps=;date=10.12.2016;rev=;days=1;user='
로 출력을 기다리고 있었다 파이썬에서 정규 표현식을 사용하여 문자열로 날짜를 삽입하려고했다 다시하지만 난 있어요 대신이
'branch=;deps=;**\x88.12.2016**;rev=;days=1;user='
또 다른 것은 내가 날짜 변수에 일부 문자열이 있다면, 그냥 잘 대체.
date="hello"
re.sub(r'(.*)(date=[^;]*)(.*)','\\1\\2'+date+'\\3',link)
는
'branch=;deps=;**date=hello**;rev=;days=1;user='
는 여기에서 문제가 될 수 있습니다?
감사 인사. 이제 작동합니다. :) –