title: Check if particular string exist in text either at first or second position
body: <p>I am trying to find the list of strings in the entire column of data frame “Name”. If particular string is exist at first or 2nd position then it should replace the text value of column with that particular string and store it in another column.</p>
  <p>For that I am using regex. Below is my code. However, in the output table I am getting match against the “MEDICO SYSTEMS FUJI” as “FUJI” But my requirement is as it exist at 3rd position it should return “NA”.  Similarly for text “SAFEAIR TERM LTD CONTRACTORS” getting match as “LTD CONTRACTORS”. It should show NA as the position is 3rd.</p>
  <p>please check my current output table from the existing script and my desired output table.</p>
  <pre><code>df = pd.DataFrame({'Name': ['KK FUJI PARLIGHT','NORTHWINDS ABATEMENT LLC',
  'SAFEAIR TERM LTD CONTRACTORS','MEDICO SYSTEMS FUJI','TOKAI','FUJI CONTRACTOR']})
  
  strings = ['FUJI','NORTHWINDS ABATEMENT','LTD CONTRACTORS']
  pattern = '|'.join(strings)
  
  def pattern_searcher(search_str:str, search_list:str):
  
      search_obj = re.search(re.compile(r'\b({0})\b'.format(search_list),flags=re.IGNORECASE), search_str)
      if search_obj :
          return_str = search_str[search_obj.start(): search_obj.end()]
      else:
          return_str = 'NA'
      return return_str
  
  df['matched_str'] = df['Name'].apply(lambda x: pattern_searcher(search_str=x, search_list=pattern))
  </code></pre>
  <p>Current output:</p>
  <pre><code>Name                                 matched_str
  KK FUJI PARLIGHT                     FUJI           
  NORTHWINDS ABATEMENT LLC             NORTHWINDS ABATEMENT
  SAFEAIR TERM LTD CONTRACTORS         LTD CONTRACTORS
  MEDICO SYSTEMS FUJI                  FUJI
  TOKAI                                NA
  FUJI CONTRACTOR                      FUJI
  </code></pre>
  <p>Desired output:</p>
  <pre><code>Name                             matched_str
  KK FUJI PARLIGHT                 FUJI
  NORTHWINDS ABATEMENT LLC         NORTHWINDS ABATEMENT
  SAFEAIR TERM LTD CONTRACTORS     NA
  MEDICO SYSTEMS FUJI              NA
  TOKAI                            NA
  FUJI CONTRACTOR                  FUJI
  </code></pre>