line='/link/abcd' pattern='/link/abcd(\/.*)?' m=re.match(pattern,line)
import re
line='/link/abcd/fdfs'
pattern='/link/abcd(\/.*)$'
m=re.match(pattern,line)
if (m):
print "Okay"
else:
print "WTF????"
import re
line='/link/abcd'
pattern='^/link/(abcd)/(.*)$'
m=re.match(pattern,line)
if (m):
print "Okay"
else:
print "WTF????"