import res = '100 BROAD' print re.sub('ROAD$', 'RD.', s) print re.sub('\bROAD$', 'RD.', s) print re.sub(r'bROAD$', 'RD.', s) s = '100 BROAD ROAD APT. 3' print re.sub(r'bROAD$', 'RD.', s) print re.sub(r'bROADb', 'RD.', s)
Name (required)
email (will not be published) (required)
Website