title: Pandas : Find the first occurence of a string then take all characters thereafter up until anther string
body: <p>I'm looking to update a column with the ISIN or CUSIP portion of a string which is contained in another column:</p>
  
  <pre><code>my_DestSystemNote1_string =  'ISIN=XS1906311763|CUSIP=         |CalTyp=1'
  dfDest = [('DestSystemNote1', ['ISIN=XS1906311763|CUSIP=         |CalTyp=1', 
                                 'ISIN=XS0736418962|CUSIP=         |CalTyp=1', 
                                 'ISIN=XS1533910508|CUSIP=         |CalTyp=1', 
                                 'ISIN=US404280AS86|CUSIP=404280AS8|CalTyp=1', 
                                 'ISIN=US404280BW89|CUSIP=404280BW8|CalTyp=21',
                                 'ISIN=US06738EBC84|CUSIP=06738EBC8|CalTyp=21',
                                 'ISIN=XS0736418962|CUSIP=         |CalTyp=1',]),
           ]
  # create pandas df
  dfDest = pd.DataFrame.from_items(dfDest)
  display(dfDest)
  print("")
  </code></pre>
  
  <p><code>DestSystemNote1</code> contains the source string from which either ISIN or CUSIP need to be extracted:</p>
  
  <pre><code>DestSystemNote1                                Found_ISIN    Found_CUSIP
  ISIN=XS1906311763|CUSIP=         |CalTyp=1     XS1906311763
  ISIN=XS0736418962|CUSIP=         |CalTyp=1     XS0736418962
  ISIN=XS1533910508|CUSIP=         |CalTyp=1     XS1533910508
  ISIN=US404280AS86|CUSIP=404280AS8|CalTyp=1     US404280AS86  404280AS8
  ISIN=US404280BW89|CUSIP=404280BW8|CalTyp=21    US404280BW89  404280BW8
  ISIN=US06738EBC84|CUSIP=06738EBC8|CalTyp=21    US06738EBC84  06738EBC8
  ISIN=XS0736418962|CUSIP=         |CalTyp=1     XS0736418962
  </code></pre>
  
  <p>ISIN's will always be preceeded by "ISIN=" and end a character before "|"</p>
  
  <p>CUSIPS's will always be preceeded by "CUSIP=" and end a character before "|"</p>
  
  <p>My attempt is as follows:</p>
  
  <pre><code>my_DestSystemNote1_string =  'ISIN=XS1906311763|CUSIP=         |CalTyp=1'
  code = my_DestSystemNote1_string.split("ISIN=",1)[1]
  code = code[:12]
  print(code)
  
  XS1906311763
  </code></pre>
  
  <p>So I'm getting there but would like to paramaterise it to find the nth occurence of a passed string (strStart) then take all characters after it's end char + 1 and up to, but not including; the nth occurence of another string (strEnd).</p>
  
  <p>Pete </p>