title: Replace the word ROAD with RD
body: <p>In the below mentioned code whenever I am replacing the word ROAD with RD., then word BROAD is also getting replaced to BRD.</p>
  
  <pre><code>def subst(pattern, replace_str, string):
      #new_string = [word.replace(pattern,replace_str) for word in string]
      new_string=[]
      for word in string:
          if re.match(pattern, word):
              new_string.append(word.replace(pattern,replace_str))
          else:
              new_string.append(word)
      #susbstitute pattern and return it
      return new_string
  
  
  def main():
      addr = ['100 NORTH MAIN ROAD',
              '100 BROAD ROAD APT.',
              'SAROJINI DEVI ROAD',
              'BROAD AVENUE ROAD']
  
      #Create pattern Implementation here 
  
      #Use subst function to replace 'ROAD' to 'RD.',Store as new_address
      new_address= subst('ROAD','RD.',addr)
      return new_address
  </code></pre>