How to re.sub() a optional matching group using regex in Python?,"re.sub('url((?:#[0-9]+)?)', 'new_url\\1', test2)"