What I want to do is to replace href="..." with href="abc/...". Except that when ... is http:// and https://
I have successfully done the first part, but I could not find a way to detect http:// and https://, following is the codes:
line='<a href="img/a.html"/>'
print re.sub(r'href="([^<#][^"]*)"',r'href="abc/\1"', line)
//Correct Output: <a href="abc/img/a.html"/>
line='<a href="http://google.com"/>'
print re.sub(r'href="([^<#][^"]*)"',r'href="abc/\1"', line)
//WrongOutput: <a href="abc/http://google.com"/>